You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Hans J. Prueller" <ha...@gmx.net> on 2007/03/28 20:47:39 UTC

WARNING: Connection not closed by caller - messages produced by OpenJPA?

Hi together,

I succeeded in integrating OpenJPA into our J2EE1.4 container, running
side-by-side within the same JTA transactions as
container managed EJB2.1 CMP entity beans.

The lookup/creation of the EntityManager instances is synchronizing with
the JTA TXs as you suggested some weeks ago
on this list.

After having a test server up and running for some days, we are
encountering lots of those messages:

WARNING: Connection not closed by caller

Suddenly (some hours later), a transactions fails:

2007-03-27 14:57:07,097 : WARNING :  Logger.log :    Conflict with
bb14:38:0:01fb60a716b0bed67c...80c679:
2007-03-27 14:57:07,113 : WARNING :  Logger.log :    Current Tx is
bb14:38:0:01fb60a716b0bed67c...32a266:
2007-03-27 14:57:07,144 : WARNING :  Logger.log :    You should not
modify the bean without a transactional context


2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system exception in
business method:javax.ejb.EJBException: Conflict writing entity bean

Somehow this HAS to be related to the OpenJPA integration, but the
server was up for at least a day and running fine until above error
occured. Any idea how this bad conflict could be caused? 

regards,
Hans

RE: WARNING: Connection not closed by caller -messagesproducedbyOpenJPA?

Posted by Patrick Linskey <pl...@bea.com>.
> As I mentioned, there is a static EMF in a helper class used 
> to obtain the EM's called from different
> threads. does above property also resolve multithreaded 
> access to the EMF? 

No. The EMF is always thread-safe (or should be, at least).

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Hans J. Prueller [mailto:hans.prueller@gmx.net] 
> Sent: Wednesday, March 28, 2007 10:10 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: WARNING: Connection not closed by caller 
> -messagesproducedbyOpenJPA?
> 
> >> If you want to access a single EM from multiple
> >> threads, you should set the openjpa.Multithreaded property 
> accordingly
> 
> As I mentioned, there is a static EMF in a helper class used 
> to obtain the EM's called from different
> threads. does above property also resolve multithreaded 
> access to the EMF? 
> 
> Hans
> 
> Am Mittwoch, den 28.03.2007, 13:30 -0700 schrieb Patrick Linskey: 
> 
> 	
> 	> I will give it a try. Can you explicitly confirm that it 
> 	> shouldn't be a multithreading problem where there are 
> 	> serveral entitymanagers
> 	> created in different JTA transactions running in 
> parallel? e.g.
> 	
> 	Assuming that the different JTA transactions are on 
> different threads,
> 	and that you do not try to access one EM from multiple 
> threads, there
> 	should be no problem. (If you want to access a single 
> EM from multiple
> 	threads, you should set the openjpa.Multithreaded 
> property accordingly.)
> 	
> 	Also, it would be useful to see a JDBC trace-level log 
> of the system
> 	running through a couple of transactions. That might 
> give us an idea of
> 	how things are working.
> 	
> 	Are you ever sharing EMs across multiple sequential JTA 
> transactions?
> 	
> 	-Patrick
> 	
> 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

RE: WARNING: Connection not closed by caller - messagesproducedbyOpenJPA?

Posted by "Hans J. Prueller" <ha...@gmx.net>.
>> If you want to access a single EM from multiple
>> threads, you should set the openjpa.Multithreaded property
accordingly

As I mentioned, there is a static EMF in a helper class used to obtain
the EM's called from different
threads. does above property also resolve multithreaded access to the
EMF? 

Hans

Am Mittwoch, den 28.03.2007, 13:30 -0700 schrieb Patrick Linskey:

> > I will give it a try. Can you explicitly confirm that it 
> > shouldn't be a multithreading problem where there are 
> > serveral entitymanagers
> > created in different JTA transactions running in parallel? e.g.
> 
> Assuming that the different JTA transactions are on different threads,
> and that you do not try to access one EM from multiple threads, there
> should be no problem. (If you want to access a single EM from multiple
> threads, you should set the openjpa.Multithreaded property accordingly.)
> 
> Also, it would be useful to see a JDBC trace-level log of the system
> running through a couple of transactions. That might give us an idea of
> how things are working.
> 
> Are you ever sharing EMs across multiple sequential JTA transactions?
> 
> -Patrick
> 

RE: WARNING: Connection not closed by caller -messagesproducedbyOpenJPA?

Posted by Patrick Linskey <pl...@bea.com>.
> I.e. 2 different threads accessing the EMF to create the EM 
> in parallel could be the cause of the problem?

That should not be a problem.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Hans J. Prueller [mailto:hans.prueller@gmx.net] 
> Sent: Wednesday, March 28, 2007 10:00 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: WARNING: Connection not closed by caller 
> -messagesproducedbyOpenJPA?
> 
> Am Mittwoch, den 28.03.2007, 13:30 -0700 schrieb Patrick Linskey:
> 
> 
> 	Are you ever sharing EMs across multiple sequential JTA 
> transactions?
> 	
> 
> 
> As far as I can say: definitely NO. But the EMF used to 
> create the EM's is held as a static member of a Helper Class.
> I.e. 2 different threads accessing the EMF to create the EM 
> in parallel could be the cause of the problem?
> 
> Hans 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

RE: WARNING: Connection not closed by caller - messagesproducedbyOpenJPA?

Posted by "Hans J. Prueller" <ha...@gmx.net>.
Am Mittwoch, den 28.03.2007, 13:30 -0700 schrieb Patrick Linskey:

> Are you ever sharing EMs across multiple sequential JTA transactions?


As far as I can say: definitely NO. But the EMF used to create the EM's
is held as a static member of a Helper Class.
I.e. 2 different threads accessing the EMF to create the EM in parallel
could be the cause of the problem?

Hans

RE: WARNING: Connection not closed by caller - messagesproducedbyOpenJPA?

Posted by Patrick Linskey <pl...@bea.com>.
> I will give it a try. Can you explicitly confirm that it 
> shouldn't be a multithreading problem where there are 
> serveral entitymanagers
> created in different JTA transactions running in parallel? e.g.

Assuming that the different JTA transactions are on different threads,
and that you do not try to access one EM from multiple threads, there
should be no problem. (If you want to access a single EM from multiple
threads, you should set the openjpa.Multithreaded property accordingly.)

Also, it would be useful to see a JDBC trace-level log of the system
running through a couple of transactions. That might give us an idea of
how things are working.

Are you ever sharing EMs across multiple sequential JTA transactions?

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Hans J. Prueller [mailto:hans.prueller@gmx.net] 
> Sent: Wednesday, March 28, 2007 1:08 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: WARNING: Connection not closed by caller - 
> messagesproducedbyOpenJPA?
> 
> Am Mittwoch, den 28.03.2007, 12:43 -0700 schrieb Patrick Linskey:
> 
> 
> 	What happens if you set 'openjpa.TransactionMode' to 
> 'managed' as well?
> 	
> 
> 
> I will give it a try. Can you explicitly confirm that it 
> shouldn't be a multithreading problem where there are 
> serveral entitymanagers
> created in different JTA transactions running in parallel? e.g.
> 
> TX A starts
> EM A created
> A working
> TX B starts
> EM B created
> A and B working
> (this is where we currently get the errors)
> ...
> 
> 
> 
> 	Also, are you closing your EMs at the end of the transaction? 
> 	
> 
> 
> not really. the problem is that we have serveral methods 
> calling each other - each of it creating its own EM at the 
> beginning. (which
> will be the same EM instance regarding to the lookup code we 
> implementend - see previous mail). So close() of a sub-method would
> call the "outer"     methods EM too I guess?
> 
> Hans 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

RE: WARNING: Connection not closed by caller - messages producedbyOpenJPA?

Posted by "Hans J. Prueller" <ha...@gmx.net>.
Am Mittwoch, den 28.03.2007, 12:43 -0700 schrieb Patrick Linskey:

> What happens if you set 'openjpa.TransactionMode' to 'managed' as
> well?


I will give it a try. Can you explicitly confirm that it shouldn't be a
multithreading problem where there are serveral entitymanagers
created in different JTA transactions running in parallel? e.g.

TX A starts
EM A created
A working
TX B starts
EM B created
A and B working
(this is where we currently get the errors)
...

> 
> Also, are you closing your EMs at the end of the transaction? 


not really. the problem is that we have serveral methods calling each
other - each of it creating its own EM at the beginning. (which
will be the same EM instance regarding to the lookup code we
implementend - see previous mail). So close() of a sub-method would
call the "outer"     methods EM too I guess?

Hans

RE: WARNING: Connection not closed by caller - messages producedbyOpenJPA?

Posted by Patrick Linskey <pl...@bea.com>.
What happens if you set 'openjpa.TransactionMode' to 'managed' as well?

Also, are you closing your EMs at the end of the transaction?

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Hans J. Prueller [mailto:hans.prueller@gmx.net] 
> Sent: Wednesday, March 28, 2007 12:14 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: WARNING: Connection not closed by caller - 
> messages producedbyOpenJPA?
> 
> The usage case of the EM is, that I call a 
> PersistenceService.getEntityManager() method in every method 
> of my SLSB's, the SLSBs all have
> the "Required" attribute set for TXs, so every time I call 
> the getEM() method, there should be an already running JTA TX. 
> 
> This is the code:
> 
> 
> logger.log(Level.FINEST,
> "creating a fresh, clean EntityManager from JNDI EMF.");
> 
> // EntityManagerFactory emf = OpenJPAPersistence
> // .createEntityManagerFactory(EMF_JNDI_LOCATION, (Context) null);
> 
> final EntityManagerFactory emf = getEMF();
> 
> final BrokerFactory bf = OpenJPAPersistence.toBrokerFactory(emf);
> 
> final Broker b = bf.newBroker(bf.getConfiguration()
> .getConnectionUserName(), bf.getConfiguration()
> .getConnectionPassword(), true, // the broker is part of a 
> JTA  managed tx
> bf.getConfiguration().getConnectionRetainModeConstant(), 
> true); // look for an existing Broker on the tx
> 
> // do some JPA configuration setup. Logic stolen from
> // EntityManagerFactoryImpl.
> b.setAutoDetach(AutoDetach.DETACH_CLOSE, true);
> b.setAutoDetach(AutoDetach.DETACH_ROLLBACK, true);
> b.setDetachedNew(false);
> 
> return OpenJPAPersistence.toEntityManager(b);
> 
> 
> And here you have the persistence.xml:
> 
> <persistence-unit name="lbsims" transaction-type="JTA">
> <provider>
> org.apache.openjpa.persistence.PersistenceProviderImpl
> </provider>
> <jta-data-source>jdbc_lbsims</jta-data-source>
> <properties>
> <property name="openjpa.ConnectionFactoryMode"
> value="managed" />
> <property name="openjpa.ManagedRuntime"
> value="jndi(TransactionManagerName=java:comp/UserTransaction)" />
> <property name="openjpa.DataCache" value="true"/>
> <property name="openjpa.RemoteCommitProvider" value="sjvm"/> 
> </properties>
> </persistence-unit>
> 
> hth,
> HANS
> 
> 
> 
> Am Mittwoch, den 28.03.2007, 11:54 -0700 schrieb Patrick Linskey: 
> 
> 	
> 	Also, how are you integrating it with the JTA 
> transaction? Are you
> 	calling EM.joinTransaction(), or ensuring that the 
> transaction is in
> 	progress before creating the EM, or something else?
> 	
> 	-Patrick
> 	
> 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

RE: WARNING: Connection not closed by caller - messages produced byOpenJPA?

Posted by "Hans J. Prueller" <ha...@gmx.net>.
The usage case of the EM is, that I call a
PersistenceService.getEntityManager() method in every method of my
SLSB's, the SLSBs all have
the "Required" attribute set for TXs, so every time I call the getEM()
method, there should be an already running JTA TX. 

This is the code:


logger.log(Level.FINEST,
				"creating a fresh, clean EntityManager from JNDI EMF.");

		// EntityManagerFactory emf = OpenJPAPersistence
		// .createEntityManagerFactory(EMF_JNDI_LOCATION, (Context) null);

		final EntityManagerFactory emf = getEMF();

		final BrokerFactory bf = OpenJPAPersistence.toBrokerFactory(emf);

		final Broker b = bf.newBroker(bf.getConfiguration()
				.getConnectionUserName(), bf.getConfiguration()
				.getConnectionPassword(), true, // the broker is part of a JTA
managed tx
				bf.getConfiguration().getConnectionRetainModeConstant(), true); //
look for an existing Broker on the tx

		// do some JPA configuration setup. Logic stolen from
		// EntityManagerFactoryImpl.
		b.setAutoDetach(AutoDetach.DETACH_CLOSE, true);
		b.setAutoDetach(AutoDetach.DETACH_ROLLBACK, true);
		b.setDetachedNew(false);

		return OpenJPAPersistence.toEntityManager(b);


And here you have the persistence.xml:

<persistence-unit name="lbsims" transaction-type="JTA">
		<provider>
			org.apache.openjpa.persistence.PersistenceProviderImpl
		</provider>
		<jta-data-source>jdbc_lbsims</jta-data-source>
		<properties>
			<property name="openjpa.ConnectionFactoryMode"
				value="managed" />
			<property name="openjpa.ManagedRuntime"
				value="jndi(TransactionManagerName=java:comp/UserTransaction)" />
			<property name="openjpa.DataCache" value="true"/>
			<property name="openjpa.RemoteCommitProvider" value="sjvm"/>		
		</properties>
	</persistence-unit>

hth,
HANS



Am Mittwoch, den 28.03.2007, 11:54 -0700 schrieb Patrick Linskey:

> Also, how are you integrating it with the JTA transaction? Are you
> calling EM.joinTransaction(), or ensuring that the transaction is in
> progress before creating the EM, or something else?
> 
> -Patrick
> 

RE: WARNING: Connection not closed by caller - messages produced byOpenJPA?

Posted by Patrick Linskey <pl...@bea.com>.
Also, how are you integrating it with the JTA transaction? Are you
calling EM.joinTransaction(), or ensuring that the transaction is in
progress before creating the EM, or something else?

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Hans J. Prueller [mailto:hans.prueller@gmx.net] 
> Sent: Wednesday, March 28, 2007 11:48 AM
> To: open-jpa-dev
> Subject: WARNING: Connection not closed by caller - messages 
> produced byOpenJPA?
> 
> Hi together,
> 
> I succeeded in integrating OpenJPA into our J2EE1.4 
> container, running side-by-side within the same JTA transactions as
> container managed EJB2.1 CMP entity beans.
> 
> The lookup/creation of the EntityManager instances is 
> synchronizing with the JTA TXs as you suggested some weeks ago
> on this list.
> 
> After having a test server up and running for some days, we 
> are encountering lots of those messages:
> 
> WARNING: Connection not closed by caller
> 
> Suddenly (some hours later), a transactions fails:
> 
> 2007-03-27 14:57:07,097 : WARNING :  Logger.log :    Conflict 
> with bb14:38:0:01fb60a716b0bed67c...80c679:
> 2007-03-27 14:57:07,113 : WARNING :  Logger.log :    Current 
> Tx is bb14:38:0:01fb60a716b0bed67c...32a266:
> 2007-03-27 14:57:07,144 : WARNING :  Logger.log :    You 
> should not modify the bean without a transactional context
> 
> 
> 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system 
> exception in business method:javax.ejb.EJBException: Conflict 
> writing entity bean
> 
> Somehow this HAS to be related to the OpenJPA integration, 
> but the server was up for at least a day and running fine 
> until above error
> occured. Any idea how this bad conflict could be caused? 
> 
> regards,
> Hans 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

RE: RE: WARNING: Connection not closed by caller - messages produced byOpenJPA?

Posted by "Hans J. Prueller" <ha...@gmx.net>.
Hi,

BAD NEWS. Unfortuately, the approach of adding a TransactionListener did
NOT work out:

2007-03-30 18:58:15,102 : ConnectionManager.freeConnections : WARNING:
Connection not closed by caller
2007-03-30 18:58:15,107 : JFactory.postInvoke : Could not commit
transaction:<4|false|0.9.7-incubating-SNAPSHOT>
org.apache.openjpa.util.CallbackException: The context has been closed.
The stack trace at which the context was closed is available if
Runtime=TRACE logging is enabled.


seems that the transactional context was closed before OpenJPA's TX
listener is invoked - can anybody explain that?

Hans

Am Donnerstag, den 29.03.2007, 10:09 -0700 schrieb Patrick Linskey:

> > to come from OpenJPA as it occurs since we've integrated OpenJPA.
> > So you think that this message comes from somewhere else? Interesting.
> 
> Yes, I expect it's coming from your transaction manager.
> 
> I suspect that the issue might have to do with the fact that you're not
> calling close() on your EMs. Sadly, the JPA spec requires that we must
> not allow operations to succeed after close() has been invoked.
> 
> So I think that the goal here is to have OpenJPA automatically close the
> EntityManager upon completion of the transaction. This essentially
> emulates the container-managed transactional persistence context
> behavior of JPA in a normal Java EE 5 JTA environment, except that this
> EM will no longer be usable, whereas in a Java EE 5 environment,
> subsequent uses of the EM would bring to life a new persistence context.
> I think that you can do this by registering an
> org.apache.openjpa.event.EndTransactionListener. You can do so by adding
> this to your broker creation steps:
> 
> broker.addTransactionListener(new AbstractTransactionListener() {
>     public void afterCommitComplete(TransactionEvent te) {
>         ((Broker) te.getSource()).close();
>     }
> 
>     public void afterRollbackComplete(TransactionEvent te) {
>         ((Broker) te.getSource()).close();
>     }
> }
> 
> Note that you could be slighly more efficient by implementing
> EndTransactionListener instead of extending AbstractTransactionListener,
> since OpenJPA would not need to invoke the no-op implementations of the
> other parts of the TransactionListener lifecycle. This should not be a
> significant performance hit, though.
> 
> If somehow you're holding onto a reference to the EM across multiple
> transactions, or the pool is somehow doling out duplicates or something,
> you should now see exceptions thrown indicating that the EM is closed.
> Alternately, if the EM was holding onto resources that the appserver
> thinks should have been re-pooled, that should now go away.
> 
> -Patrick
> 
> -- 
> Patrick Linskey
> BEA Systems, Inc. 
> 
> _______________________________________________________________________
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it. 
> 
> > -----Original Message-----
> > From: Hans Prueller [mailto:hans.prueller@gmx.net] 
> > Sent: Thursday, March 29, 2007 3:44 AM
> > To: open-jpa-dev@incubator.apache.org; 
> > open-jpa-dev@incubator.apache.org
> > Subject: Re: RE: WARNING: Connection not closed by caller - 
> > messages produced byOpenJPA?
> > 
> > Thank you for your ideas.
> > 
> > I expected the message 
> > 
> > "WARNING: Connection not closed by caller"
> > 
> > to come from OpenJPA as it occurs since we've integrated OpenJPA.
> > So you think that this message comes from somewhere else? Interesting.
> > 
> > What we are doing is that we have several EJB2.1 CMP Entity Beans that
> > are created/updated within SLSB's methods. One of those CMP 
> > Entity Beans
> > is now "converted" to be an OpenJPA Pojo. So we are working 
> > on CMP EBs AND
> > OpenJPA persistent pojos within the same SLSB method (and TX).
> > 
> > The really strange thing is that this co-existence worked 
> > fine as long as there was only 1 application client issuing 
> > requests to our server. As soon as we tested with 2 
> > concurrent clients and both of them issued requests 
> > simultaneously, we got that "Conflict writing entity bean" error. 
> > 
> > "The connection not closed by caller message" occurs 
> > permanently. Perhaps the container does not close the 
> > connection as it "knows" that there are other than CMP EB 
> > clients (ie the openJPA pojo) using the same connection. So 
> > perhaps it would be required to call em.close(); at the end 
> > of every transaction?
> > 
> > Meanwhile I will try to find out where this 
> > "WARNING: Connection not closed by caller" message is coming from..
> > 
> > hans
> > 
> > -------- Original-Nachricht --------
> > Datum: Thu, 29 Mar 2007 01:46:19 -0700
> > Von: "Patrick Linskey" <pl...@bea.com>
> > An: open-jpa-dev@incubator.apache.org
> > Betreff: RE: WARNING: Connection not closed by caller - 
> > messages produced byOpenJPA?
> > 
> > > So my feeling is that we need to get to the bottom of the "WARNING:
> > > Connection not closed by caller" line. Do you have any idea 
> > what part of
> > > your framework is issuing that statement, and under what 
> > situations it
> > > can happen? Can you get a stack from when it is issued?
> > > 
> > > 
> > > > 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system 
> > > > exception in business method:javax.ejb.EJBException: Conflict 
> > > > writing entity bean
> > > 
> > > Similarly, do you know more details about where this is failing? The
> > > exception seems to be happening because of concurrent 
> > access to entity
> > > beans (i.e., not JPA entities). Are you using BMP entity 
> > beans backed by
> > > JPA entities or something like that? Is it possible to get 
> > a stack from
> > > where this message is logged, or at least more details 
> > about what the
> > > biz method in question is?
> > > 
> > > (None of the messages you've posted look like anything that OpenJPA
> > > would ever generate.)
> > > 
> > > -Patrick
> > > 
> > > -- 
> > > Patrick Linskey
> > > BEA Systems, Inc. 
> > > 
> > > 
> > ______________________________________________________________
> > _________
> > > Notice:  This email message, together with any attachments, 
> > may contain
> > > information  of  BEA Systems,  Inc.,  its subsidiaries  and 
> >  affiliated
> > > entities,  that may be confidential,  proprietary,  
> > copyrighted  and/or
> > > legally privileged, and is intended solely for the use of 
> > the individual
> > > or entity named in this message. If you are not the 
> > intended recipient,
> > > and have received this message in error, please immediately 
> > return this
> > > by email and then delete it. 
> > > 
> > > > -----Original Message-----
> > > > From: Hans J. Prueller [mailto:hans.prueller@gmx.net] 
> > > > Sent: Wednesday, March 28, 2007 11:48 AM
> > > > To: open-jpa-dev
> > > > Subject: WARNING: Connection not closed by caller - messages 
> > > > produced byOpenJPA?
> > > > 
> > > > Hi together,
> > > > 
> > > > I succeeded in integrating OpenJPA into our J2EE1.4 
> > > > container, running side-by-side within the same JTA 
> > transactions as
> > > > container managed EJB2.1 CMP entity beans.
> > > > 
> > > > The lookup/creation of the EntityManager instances is 
> > > > synchronizing with the JTA TXs as you suggested some weeks ago
> > > > on this list.
> > > > 
> > > > After having a test server up and running for some days, we 
> > > > are encountering lots of those messages:
> > > > 
> > > > WARNING: Connection not closed by caller
> > > > 
> > > > Suddenly (some hours later), a transactions fails:
> > > > 
> > > > 2007-03-27 14:57:07,097 : WARNING :  Logger.log :    Conflict 
> > > > with bb14:38:0:01fb60a716b0bed67c...80c679:
> > > > 2007-03-27 14:57:07,113 : WARNING :  Logger.log :    Current 
> > > > Tx is bb14:38:0:01fb60a716b0bed67c...32a266:
> > > > 2007-03-27 14:57:07,144 : WARNING :  Logger.log :    You 
> > > > should not modify the bean without a transactional context
> > > > 
> > > > 
> > > > 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system 
> > > > exception in business method:javax.ejb.EJBException: Conflict 
> > > > writing entity bean
> > > > 
> > > > Somehow this HAS to be related to the OpenJPA integration, 
> > > > but the server was up for at least a day and running fine 
> > > > until above error
> > > > occured. Any idea how this bad conflict could be caused? 
> > > > 
> > > > regards,
> > > > Hans 
> > > > 
> > > 
> > > Notice:  This email message, together with any attachments, 
> > may contain
> > > information  of  BEA Systems,  Inc.,  its subsidiaries  and 
> >  affiliated
> > > entities,  that may be confidential,  proprietary,  
> > copyrighted  and/or legally
> > > privileged, and is intended solely for the use of the 
> > individual or entity
> > > named in this message. If you are not the intended 
> > recipient, and have
> > > received this message in error, please immediately return 
> > this by email and
> > > then delete it.
> > 
> > -- 
> > "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> > Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
> > 
> 
> Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

RE: RE: WARNING: Connection not closed by caller - messages produced byOpenJPA?

Posted by "Hans J. Prueller" <ha...@gmx.net>.
Am Donnerstag, den 29.03.2007, 10:09 -0700 schrieb Patrick Linskey:

> If somehow you're holding onto a reference to the EM across multiple
> transactions, or the pool is somehow doling out duplicates or
> something,
> you should now see exceptions thrown indicating that the EM is closed.
> Alternately, if the EM was holding onto resources that the appserver
> thinks should have been re-pooled, that should now go away.
> 
> -Patrick 


Thank you for your thoughts, Patrick. I'll add the code you suggested to
our lookup-method and hopefully
the problem will  be gone now. Otherwise I don't have any more ideas of
how to migrate to JPA in a controlled way... ;-)

BTW: I have founded the "EJB23" project on dev.java.net
(http://ejb23.dev.java.net) which SHALL (soon) provide
documentation and tools for people who are trying to migrate EJB2.1 EJBs
to EJB3 as we are doing it. I also started
to write a "migration diary" where I wanted to document all the required
steps and encountered problems within
our migration process, also the current stuff we're doing with openJPA.
If anybody is interested: feel free to add
your comments and ideas or just regularly check my progress ;-) in the
wiki: http://wiki.java.net/bin/view/Projects/Ejb23
or directly:
http://wiki.java.net/bin/view/Projects/HanzzEjb23MigrationDiary

If we'll succeed in migrating our CMP beans to OpenJPA - expect above
Project/Wiki to be a good advertising for OpenJPA *gg*

Anyway -thank you for your support! Keep up the good work!

Hans

RE: RE: WARNING: Connection not closed by caller - messages produced byOpenJPA?

Posted by Patrick Linskey <pl...@bea.com>.
> to come from OpenJPA as it occurs since we've integrated OpenJPA.
> So you think that this message comes from somewhere else? Interesting.

Yes, I expect it's coming from your transaction manager.

I suspect that the issue might have to do with the fact that you're not
calling close() on your EMs. Sadly, the JPA spec requires that we must
not allow operations to succeed after close() has been invoked.

So I think that the goal here is to have OpenJPA automatically close the
EntityManager upon completion of the transaction. This essentially
emulates the container-managed transactional persistence context
behavior of JPA in a normal Java EE 5 JTA environment, except that this
EM will no longer be usable, whereas in a Java EE 5 environment,
subsequent uses of the EM would bring to life a new persistence context.
I think that you can do this by registering an
org.apache.openjpa.event.EndTransactionListener. You can do so by adding
this to your broker creation steps:

broker.addTransactionListener(new AbstractTransactionListener() {
    public void afterCommitComplete(TransactionEvent te) {
        ((Broker) te.getSource()).close();
    }

    public void afterRollbackComplete(TransactionEvent te) {
        ((Broker) te.getSource()).close();
    }
}

Note that you could be slighly more efficient by implementing
EndTransactionListener instead of extending AbstractTransactionListener,
since OpenJPA would not need to invoke the no-op implementations of the
other parts of the TransactionListener lifecycle. This should not be a
significant performance hit, though.

If somehow you're holding onto a reference to the EM across multiple
transactions, or the pool is somehow doling out duplicates or something,
you should now see exceptions thrown indicating that the EM is closed.
Alternately, if the EM was holding onto resources that the appserver
thinks should have been re-pooled, that should now go away.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Hans Prueller [mailto:hans.prueller@gmx.net] 
> Sent: Thursday, March 29, 2007 3:44 AM
> To: open-jpa-dev@incubator.apache.org; 
> open-jpa-dev@incubator.apache.org
> Subject: Re: RE: WARNING: Connection not closed by caller - 
> messages produced byOpenJPA?
> 
> Thank you for your ideas.
> 
> I expected the message 
> 
> "WARNING: Connection not closed by caller"
> 
> to come from OpenJPA as it occurs since we've integrated OpenJPA.
> So you think that this message comes from somewhere else? Interesting.
> 
> What we are doing is that we have several EJB2.1 CMP Entity Beans that
> are created/updated within SLSB's methods. One of those CMP 
> Entity Beans
> is now "converted" to be an OpenJPA Pojo. So we are working 
> on CMP EBs AND
> OpenJPA persistent pojos within the same SLSB method (and TX).
> 
> The really strange thing is that this co-existence worked 
> fine as long as there was only 1 application client issuing 
> requests to our server. As soon as we tested with 2 
> concurrent clients and both of them issued requests 
> simultaneously, we got that "Conflict writing entity bean" error. 
> 
> "The connection not closed by caller message" occurs 
> permanently. Perhaps the container does not close the 
> connection as it "knows" that there are other than CMP EB 
> clients (ie the openJPA pojo) using the same connection. So 
> perhaps it would be required to call em.close(); at the end 
> of every transaction?
> 
> Meanwhile I will try to find out where this 
> "WARNING: Connection not closed by caller" message is coming from..
> 
> hans
> 
> -------- Original-Nachricht --------
> Datum: Thu, 29 Mar 2007 01:46:19 -0700
> Von: "Patrick Linskey" <pl...@bea.com>
> An: open-jpa-dev@incubator.apache.org
> Betreff: RE: WARNING: Connection not closed by caller - 
> messages produced byOpenJPA?
> 
> > So my feeling is that we need to get to the bottom of the "WARNING:
> > Connection not closed by caller" line. Do you have any idea 
> what part of
> > your framework is issuing that statement, and under what 
> situations it
> > can happen? Can you get a stack from when it is issued?
> > 
> > 
> > > 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system 
> > > exception in business method:javax.ejb.EJBException: Conflict 
> > > writing entity bean
> > 
> > Similarly, do you know more details about where this is failing? The
> > exception seems to be happening because of concurrent 
> access to entity
> > beans (i.e., not JPA entities). Are you using BMP entity 
> beans backed by
> > JPA entities or something like that? Is it possible to get 
> a stack from
> > where this message is logged, or at least more details 
> about what the
> > biz method in question is?
> > 
> > (None of the messages you've posted look like anything that OpenJPA
> > would ever generate.)
> > 
> > -Patrick
> > 
> > -- 
> > Patrick Linskey
> > BEA Systems, Inc. 
> > 
> > 
> ______________________________________________________________
> _________
> > Notice:  This email message, together with any attachments, 
> may contain
> > information  of  BEA Systems,  Inc.,  its subsidiaries  and 
>  affiliated
> > entities,  that may be confidential,  proprietary,  
> copyrighted  and/or
> > legally privileged, and is intended solely for the use of 
> the individual
> > or entity named in this message. If you are not the 
> intended recipient,
> > and have received this message in error, please immediately 
> return this
> > by email and then delete it. 
> > 
> > > -----Original Message-----
> > > From: Hans J. Prueller [mailto:hans.prueller@gmx.net] 
> > > Sent: Wednesday, March 28, 2007 11:48 AM
> > > To: open-jpa-dev
> > > Subject: WARNING: Connection not closed by caller - messages 
> > > produced byOpenJPA?
> > > 
> > > Hi together,
> > > 
> > > I succeeded in integrating OpenJPA into our J2EE1.4 
> > > container, running side-by-side within the same JTA 
> transactions as
> > > container managed EJB2.1 CMP entity beans.
> > > 
> > > The lookup/creation of the EntityManager instances is 
> > > synchronizing with the JTA TXs as you suggested some weeks ago
> > > on this list.
> > > 
> > > After having a test server up and running for some days, we 
> > > are encountering lots of those messages:
> > > 
> > > WARNING: Connection not closed by caller
> > > 
> > > Suddenly (some hours later), a transactions fails:
> > > 
> > > 2007-03-27 14:57:07,097 : WARNING :  Logger.log :    Conflict 
> > > with bb14:38:0:01fb60a716b0bed67c...80c679:
> > > 2007-03-27 14:57:07,113 : WARNING :  Logger.log :    Current 
> > > Tx is bb14:38:0:01fb60a716b0bed67c...32a266:
> > > 2007-03-27 14:57:07,144 : WARNING :  Logger.log :    You 
> > > should not modify the bean without a transactional context
> > > 
> > > 
> > > 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system 
> > > exception in business method:javax.ejb.EJBException: Conflict 
> > > writing entity bean
> > > 
> > > Somehow this HAS to be related to the OpenJPA integration, 
> > > but the server was up for at least a day and running fine 
> > > until above error
> > > occured. Any idea how this bad conflict could be caused? 
> > > 
> > > regards,
> > > Hans 
> > > 
> > 
> > Notice:  This email message, together with any attachments, 
> may contain
> > information  of  BEA Systems,  Inc.,  its subsidiaries  and 
>  affiliated
> > entities,  that may be confidential,  proprietary,  
> copyrighted  and/or legally
> > privileged, and is intended solely for the use of the 
> individual or entity
> > named in this message. If you are not the intended 
> recipient, and have
> > received this message in error, please immediately return 
> this by email and
> > then delete it.
> 
> -- 
> "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

Re: RE: WARNING: Connection not closed by caller - messages produced byOpenJPA?

Posted by Hans Prueller <ha...@gmx.net>.
Thank you for your ideas.

I expected the message 

"WARNING: Connection not closed by caller"

to come from OpenJPA as it occurs since we've integrated OpenJPA.
So you think that this message comes from somewhere else? Interesting.

What we are doing is that we have several EJB2.1 CMP Entity Beans that
are created/updated within SLSB's methods. One of those CMP Entity Beans
is now "converted" to be an OpenJPA Pojo. So we are working on CMP EBs AND
OpenJPA persistent pojos within the same SLSB method (and TX).

The really strange thing is that this co-existence worked fine as long as there was only 1 application client issuing requests to our server. As soon as we tested with 2 concurrent clients and both of them issued requests simultaneously, we got that "Conflict writing entity bean" error. 

"The connection not closed by caller message" occurs permanently. Perhaps the container does not close the connection as it "knows" that there are other than CMP EB clients (ie the openJPA pojo) using the same connection. So perhaps it would be required to call em.close(); at the end of every transaction?

Meanwhile I will try to find out where this 
"WARNING: Connection not closed by caller" message is coming from..

hans

-------- Original-Nachricht --------
Datum: Thu, 29 Mar 2007 01:46:19 -0700
Von: "Patrick Linskey" <pl...@bea.com>
An: open-jpa-dev@incubator.apache.org
Betreff: RE: WARNING: Connection not closed by caller - messages produced byOpenJPA?

> So my feeling is that we need to get to the bottom of the "WARNING:
> Connection not closed by caller" line. Do you have any idea what part of
> your framework is issuing that statement, and under what situations it
> can happen? Can you get a stack from when it is issued?
> 
> 
> > 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system 
> > exception in business method:javax.ejb.EJBException: Conflict 
> > writing entity bean
> 
> Similarly, do you know more details about where this is failing? The
> exception seems to be happening because of concurrent access to entity
> beans (i.e., not JPA entities). Are you using BMP entity beans backed by
> JPA entities or something like that? Is it possible to get a stack from
> where this message is logged, or at least more details about what the
> biz method in question is?
> 
> (None of the messages you've posted look like anything that OpenJPA
> would ever generate.)
> 
> -Patrick
> 
> -- 
> Patrick Linskey
> BEA Systems, Inc. 
> 
> _______________________________________________________________________
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it. 
> 
> > -----Original Message-----
> > From: Hans J. Prueller [mailto:hans.prueller@gmx.net] 
> > Sent: Wednesday, March 28, 2007 11:48 AM
> > To: open-jpa-dev
> > Subject: WARNING: Connection not closed by caller - messages 
> > produced byOpenJPA?
> > 
> > Hi together,
> > 
> > I succeeded in integrating OpenJPA into our J2EE1.4 
> > container, running side-by-side within the same JTA transactions as
> > container managed EJB2.1 CMP entity beans.
> > 
> > The lookup/creation of the EntityManager instances is 
> > synchronizing with the JTA TXs as you suggested some weeks ago
> > on this list.
> > 
> > After having a test server up and running for some days, we 
> > are encountering lots of those messages:
> > 
> > WARNING: Connection not closed by caller
> > 
> > Suddenly (some hours later), a transactions fails:
> > 
> > 2007-03-27 14:57:07,097 : WARNING :  Logger.log :    Conflict 
> > with bb14:38:0:01fb60a716b0bed67c...80c679:
> > 2007-03-27 14:57:07,113 : WARNING :  Logger.log :    Current 
> > Tx is bb14:38:0:01fb60a716b0bed67c...32a266:
> > 2007-03-27 14:57:07,144 : WARNING :  Logger.log :    You 
> > should not modify the bean without a transactional context
> > 
> > 
> > 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system 
> > exception in business method:javax.ejb.EJBException: Conflict 
> > writing entity bean
> > 
> > Somehow this HAS to be related to the OpenJPA integration, 
> > but the server was up for at least a day and running fine 
> > until above error
> > occured. Any idea how this bad conflict could be caused? 
> > 
> > regards,
> > Hans 
> > 
> 
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or legally
> privileged, and is intended solely for the use of the individual or entity
> named in this message. If you are not the intended recipient, and have
> received this message in error, please immediately return this by email and
> then delete it.

-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

RE: WARNING: Connection not closed by caller - messages produced byOpenJPA?

Posted by Patrick Linskey <pl...@bea.com>.
So my feeling is that we need to get to the bottom of the "WARNING:
Connection not closed by caller" line. Do you have any idea what part of
your framework is issuing that statement, and under what situations it
can happen? Can you get a stack from when it is issued?


> 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system 
> exception in business method:javax.ejb.EJBException: Conflict 
> writing entity bean

Similarly, do you know more details about where this is failing? The
exception seems to be happening because of concurrent access to entity
beans (i.e., not JPA entities). Are you using BMP entity beans backed by
JPA entities or something like that? Is it possible to get a stack from
where this message is logged, or at least more details about what the
biz method in question is?

(None of the messages you've posted look like anything that OpenJPA
would ever generate.)

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Hans J. Prueller [mailto:hans.prueller@gmx.net] 
> Sent: Wednesday, March 28, 2007 11:48 AM
> To: open-jpa-dev
> Subject: WARNING: Connection not closed by caller - messages 
> produced byOpenJPA?
> 
> Hi together,
> 
> I succeeded in integrating OpenJPA into our J2EE1.4 
> container, running side-by-side within the same JTA transactions as
> container managed EJB2.1 CMP entity beans.
> 
> The lookup/creation of the EntityManager instances is 
> synchronizing with the JTA TXs as you suggested some weeks ago
> on this list.
> 
> After having a test server up and running for some days, we 
> are encountering lots of those messages:
> 
> WARNING: Connection not closed by caller
> 
> Suddenly (some hours later), a transactions fails:
> 
> 2007-03-27 14:57:07,097 : WARNING :  Logger.log :    Conflict 
> with bb14:38:0:01fb60a716b0bed67c...80c679:
> 2007-03-27 14:57:07,113 : WARNING :  Logger.log :    Current 
> Tx is bb14:38:0:01fb60a716b0bed67c...32a266:
> 2007-03-27 14:57:07,144 : WARNING :  Logger.log :    You 
> should not modify the bean without a transactional context
> 
> 
> 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system 
> exception in business method:javax.ejb.EJBException: Conflict 
> writing entity bean
> 
> Somehow this HAS to be related to the OpenJPA integration, 
> but the server was up for at least a day and running fine 
> until above error
> occured. Any idea how this bad conflict could be caused? 
> 
> regards,
> Hans 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

Re: WARNING: Connection not closed by caller - messages produced by OpenJPA?

Posted by "Hans J. Prueller" <ha...@gmx.net>.
Sorry, I forgot to add the following fact - which will be of MOST
interest obviously:

- analysing the logfiles where the conflicting TXs occur, it seems that
there are currently 2 THREAD RUNNING IN PARALLEL.
- each thread is working on definitely different data, so a deadlock
should not really be possible 

but I think I can remember that somebody mentioned that OpenJPA is not
safe for multithreaded usage by default and that
some special parameter has to be set in perstence.xml ? But if I
understood the discussion right, this was just if different
EMF's are using multithreaded, not the EM's - that's why I did not yet
activate this multithreaded feature. 

Is this also the case for the behaviour I described? (application
managed JPA, outside a java ee 5 container, but running inside
a java ee 1.4 container utilizing its JTA managed transactions;
multithreaded environment).

any ideas?

Hans

Am Mittwoch, den 28.03.2007, 20:47 +0200 schrieb Hans J. Prueller:

> Hi together,
> 
> I succeeded in integrating OpenJPA into our J2EE1.4 container, running
> side-by-side within the same JTA transactions as
> container managed EJB2.1 CMP entity beans.
> 
> The lookup/creation of the EntityManager instances is synchronizing
> with the JTA TXs as you suggested some weeks ago
> on this list.
> 
> After having a test server up and running for some days, we are
> encountering lots of those messages:
> 
> WARNING: Connection not closed by caller
> 
> Suddenly (some hours later), a transactions fails:
> 
> 2007-03-27 14:57:07,097 : WARNING :  Logger.log :    Conflict with
> bb14:38:0:01fb60a716b0bed67c...80c679:
> 2007-03-27 14:57:07,113 : WARNING :  Logger.log :    Current Tx is
> bb14:38:0:01fb60a716b0bed67c...32a266:
> 2007-03-27 14:57:07,144 : WARNING :  Logger.log :    You should not
> modify the bean without a transactional context
> 
> 
> 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system exception
> in business method:javax.ejb.EJBException: Conflict writing entity
> bean
> 
> Somehow this HAS to be related to the OpenJPA integration, but the
> server was up for at least a day and running fine until above error
> occured. Any idea how this bad conflict could be caused? 
> 
> regards,
> Hans

RE: WARNING: Connection not closed by caller - messages produced byOpenJPA?

Posted by Patrick Linskey <pl...@bea.com>.
Can you post your OpenJPA properties?

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Hans J. Prueller [mailto:hans.prueller@gmx.net] 
> Sent: Wednesday, March 28, 2007 11:48 AM
> To: open-jpa-dev
> Subject: WARNING: Connection not closed by caller - messages 
> produced byOpenJPA?
> 
> Hi together,
> 
> I succeeded in integrating OpenJPA into our J2EE1.4 
> container, running side-by-side within the same JTA transactions as
> container managed EJB2.1 CMP entity beans.
> 
> The lookup/creation of the EntityManager instances is 
> synchronizing with the JTA TXs as you suggested some weeks ago
> on this list.
> 
> After having a test server up and running for some days, we 
> are encountering lots of those messages:
> 
> WARNING: Connection not closed by caller
> 
> Suddenly (some hours later), a transactions fails:
> 
> 2007-03-27 14:57:07,097 : WARNING :  Logger.log :    Conflict 
> with bb14:38:0:01fb60a716b0bed67c...80c679:
> 2007-03-27 14:57:07,113 : WARNING :  Logger.log :    Current 
> Tx is bb14:38:0:01fb60a716b0bed67c...32a266:
> 2007-03-27 14:57:07,144 : WARNING :  Logger.log :    You 
> should not modify the bean without a transactional context
> 
> 
> 2007-03-27 14:57:07,160 : SEVERE :  Logger.log :    system 
> exception in business method:javax.ejb.EJBException: Conflict 
> writing entity bean
> 
> Somehow this HAS to be related to the OpenJPA integration, 
> but the server was up for at least a day and running fine 
> until above error
> occured. Any idea how this bad conflict could be caused? 
> 
> regards,
> Hans 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.