You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Christian Bjørnbak <cb...@touristonline.dk> on 2014/05/06 08:02:38 UTC

Slow startup when using a postgresql db and connecting remotely

Hi

I'm trying to get opencms that uses openjpa to connection to a remote
postgresql db.

When I start opencms on my laptop at home connecting to a database in the
office it takes minutes to start..

I had the same experience with another app using hibernate but here I
solved it by using this "secret" setting:
hibernate.temp.use_jdbc_metadata_defaults. See
http://stackoverflow.com/questions/10075081/hibernate-slow-to-acquire-postgres-connection

Does openjpa have a similar setting to avoid reading all metadata?


Opencms uses apache commons dbcp as a layer between openjpa and the
postgresql driver. I don't know if this influences solving the problem?


Med venlig hilsen / Kind regards,

Christian Bjørnbak

Chefudvikler / Lead Developer
TouristOnline A/S
Islands Brygge 43
2300 København S
Denmark
TLF: +45 32888230
Dir. TLF: +45 32888235

Re: Slow startup when using a postgresql db and connecting remotely

Posted by Rick Curtis <cu...@gmail.com>.
I am not aware of any properties that will avoid reading metadata from the
connection. It would be helpful to take a few thread dumps during the
minutes where opencms is attempting to connect to the DB so we can see what
is taking all of the time. Hope this helps.

Thanks,
Rick


On Tue, May 6, 2014 at 1:02 AM, Christian Bjørnbak <cb...@touristonline.dk>wrote:

> Hi
>
> I'm trying to get opencms that uses openjpa to connection to a remote
> postgresql db.
>
> When I start opencms on my laptop at home connecting to a database in the
> office it takes minutes to start..
>
> I had the same experience with another app using hibernate but here I
> solved it by using this "secret" setting:
> hibernate.temp.use_jdbc_metadata_defaults. See
>
> http://stackoverflow.com/questions/10075081/hibernate-slow-to-acquire-postgres-connection
>
> Does openjpa have a similar setting to avoid reading all metadata?
>
>
> Opencms uses apache commons dbcp as a layer between openjpa and the
> postgresql driver. I don't know if this influences solving the problem?
>
>
> Med venlig hilsen / Kind regards,
>
> Christian Bjørnbak
>
> Chefudvikler / Lead Developer
> TouristOnline A/S
> Islands Brygge 43
> 2300 København S
> Denmark
> TLF: +45 32888230
> Dir. TLF: +45 32888235
>



-- 
*Rick Curtis*