You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Eric Lapierre <er...@nortel.com> on 2008/03/27 20:45:42 UTC

(Unknown)

I am using openJPA 1.0.1 inside Websphere 6.1.0.

I have written a Entity listener that is trying to publish a copy of the
object onto a JMS message.
This involves serializing a copy of the object to put it on the JMS
message.

I ran into an issue where the serialization of the object causes a
reentrant flush.  I was wondering if there is an easy way
to make a copy of the object such that it can be serialized without
impacting the current transaction.

Here is the error message I get:

   R <openjpa-1.0.1-r420667:592145 fatal user error>
org.apache.openjpa.util.InvalidStateException: Detected
 reentrant flush.  Make sure your flush-time instance callback methods
or event listeners do not
 invoke any operations that require the in-progress flush to complete.
SystemErr_08.03.26_12.05.05.log:[3/25/08 9:03:55:210 GMT-05:00] 00000030
SystemErr     R 
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1848)
SystemErr_08.03.26_12.05.05.log:[3/25/08 9:03:55:210 GMT-05:00] 00000030
SystemErr     R 
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1623)
SystemErr_08.03.26_12.05.05.log:[3/25/08 9:03:55:210 GMT-05:00] 00000030
SystemErr     R 
at
org.apache.openjpa.kernel.DetachManager.flushDirty(DetachManager.java:22
3)
SystemErr_08.03.26_12.05.05.log:[3/25/08 9:03:55:216 GMT-05:00] 00000030
SystemErr     R 
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1977)
SystemErr_08.03.26_12.05.05.log:[3/25/08 9:03:55:216 GMT-05:00] 00000030
SystemErr     R 
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
SystemErr_08.03.26_12.05.05.log:[3/25/08 9:03:55:216 GMT-05:00] 00000030
SystemErr     R 
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1623)
SystemErr_08.03.26_12.05.05.log:[3/25/08 9:03:55:216 GMT-05:00] 00000030
SystemErr     R 
at
org.apache.openjpa.kernel.DetachManager.flushDirty(DetachManager.java:22
3)


Re: (no subject)

Posted by Pinaki Poddar <pp...@apache.org>.
> if there is an easy way to make a copy of the object such that it can be
serialized without impacting the > current transaction.

There is no easy answer to tis question :)
Depends on what is being 'copied' in the serialized object.

OpenJPA does provide a facility known as RemoteCommitProvider [1] that can
transmit/broadcast committed instances (not in their serialized form but
only their persistent identities) to other processes over a variety of
transport protocols (TCP, JMS etc.). 
 
This out-of-the-box facility may serve your purpose. 

[1]
http://openjpa.apache.org/docs/latest/manual/manual.html#ref_guide_event_conf
   


-- 
View this message in context: http://www.nabble.com/%28no-subject%29-tp16338591p16359700.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.