[postgis-users] Postgis concurrence question

Fernando Tong nandorov at gmail.com
Thu Nov 12 06:49:01 PST 2009


Hello Kirill,

thanks for your suggestions. I'll try to change my application (j2se) to
make it work with a connection pool.

Best regards

Fernando

On Thu, Nov 12, 2009 at 3:01 AM, Kirill Zinov <kirill.zinov at gmail.com>wrote:

>  Hello Fernando,
>
> Looks like something has not been released after you closed connection.
> This may happen due to java native. I mean garbage collector approach to
> free the objects. If you'll use a proper connection pool it will take care
> of the connections re-usage and will speed up your application.
>
> When I began my Java coding I tried a low level approach too. Thanks to my
> friend with strong skills in j2ee, I have realized the benefits from
> Hibernate and other frameworks faster.
>
> Take a look at Hibernate: https://www.hibernate.org/
>
> There is a spatial extension: http://www.hibernatespatial.org/
>
> I didn't try spatial extension as I wrote before. Even if you will decide
> not to use Hibernate, I suggest you read a few good articles about
> connection pooling. It’s a faster way to post/get data because of the
> connections re-usage. Actually this is a de facto standard in Java world.
>
> Kirill,
>
>
> Fernando Tong wrote:
>
> Hello Kiril,
>
>  I'm afraid i'm not using a connection pooling, just an static way to load
> the drivers
>
>  public class PgSQLDBConn {
>
>  static {
>  try {
>  Class.forName("org.postgresql.Driver");
>
>  } catch (Exception e) {
>  System.out.println(e.getMessage());
>  }
>  }
>
>
>  public Connection getConnection() {
>  Connection connection = null;
>  try {
>  connection =
> DriverManager.getConnection("jdbc:postgresql://localhost:5432/db_gpstracker","MYUSER","MYPWD");
>  } catch (Exception e) {
>  System.out.println(e.getMessage());
>  }
>  return connection;
>  }
> }
>
>  I call the method getConnection each time i want to connect to the
> database, execute the statements and then i close the connection (repeat
> each time i receive some data from the GPS device)
>
>  Best regards
>
>  Fernando
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20091112/0eb78028/attachment.html>


More information about the postgis-users mailing list