geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: EntityExistsException: Attempt to persist detached object
Date Mon, 26 Nov 2007 20:48:47 GMT

On Nov 26, 2007, at 12:08 PM, Jacek Laskowski wrote:

> On Nov 26, 2007 6:31 PM, David Jencks <> wrote:
>> My experience is that to get openjpa sequences to work you NEED a non
>> transactional non-jta-datasource specified in your persistence.xml
> Do you happen to know why it is this way? I remember I had to specify
> two data sources just to get it to work. Is it a Geronimo "feature"?

I don't know why this is required.  I've only investigated on derby.   
With only one datasource, when openjpa needs a sequence value, it:

- suspends the current jta transaction
- starts a new jta tx
- gets the sequence value
- commits the jta tx
- resumes the original jta tx.

If I remember correctly the problem I saw was that either inside the  
new jta tx or after resuming the original one the derby connection  
had lost track of which schema it was working in and couldn't find  
any tables.  Faced with limited time and the prospect of debugging  
the interaction of 3 systems I tried the non-jta-datasource solution  
and stopped when it worked :-)

david jencks

> Jacek
> -- 
> Jacek Laskowski

View raw message