Re: Connection usage

2007-08-23 Thread Patrick Linskey
> I still get stuck at the getResultList() call as it tries to get a > connection (same as before). Yeah, I was afraid that that might be the case. > Do I define foreign keys in my annotations using > org.apache.openjpa.persistence.jdbc.ForeignKey? Yes. -Patrick On 8/23/07, Christian Defoy <[E

Re: Connection usage

2007-08-23 Thread Christian Defoy
If I do: factory.createEntityManager().close(); manager = factory.createEntityManager(); Query query = manager.createQuery( "some query" ); query.getResultList(); I still get stuck at the getResultList() call as it tries to get a connection (same as before). Do I define foreign keys in my annot

Re: Connection usage

2007-08-23 Thread Patrick Linskey
Hi, You can definitely specify just the foreign keys that you care about in your annotations / XML. In that case, OpenJPA will only consider those FKs when doing dependency analysis. Currently, in my opinion, OpenJPA does not do enough eager loading of metadata during deployment. This dates back

Re: Connection usage

2007-08-23 Thread Christian Defoy
I found the problem... I guess that property forces OpenJPA to load up definitions for all foreign keys. I added the following property defined in my persistence.xml file. It comes from a previous post I mentioned that entities were deleted prior to their embedded objects and that was violatin

Re: Connection usage

2007-08-23 Thread Patrick Linskey
Hi, Are you listing your persistent types in your persistence.xml file? The connection is being obtained while building up the mapping information for the class, which indicates that the class meta data was not fully populated by the time that the code started executing. -Patrick On 8/23/07, Ch

Re: Connection usage

2007-08-23 Thread Christian Defoy
Hi Patrick, Here is the stack trace of the second call to getConnection(): java.lang.Exception: Stack trace at java.lang.Thread.dumpStack(Thread.java:1158) at ex5.ConnectionPool.getConnection(ConnectionPool.java:325) at org.apache.openjpa.lib.jdbc.DelegatingDataSource.get

Re: Connection usage

2007-08-23 Thread Patrick Linskey
Hi, Can you post a thread dump from the deadlock? My guess would be that we're using the second connection to fetch an ID value from a sequence table. Otherwise, we should not be obtaining multiple. -Patrick On 8/23/07, Christian Defoy <[EMAIL PROTECTED]> wrote: > Hello, > > Quick question abou