Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Two Persists within One Transactional Method
Two Persists within One Transactional Method [message #1696246] Sun, 24 May 2015 12:20 Go to next message
HC Tsai is currently offline HC TsaiFriend
Messages: 2
Registered: May 2015
Junior Member
Hi,

I use EclipseLink and JTA for transaction manager to access Oracle DB by following your example. Within a transaction, there are two calls to persist entity to DB. The second persist will insert an existing row resulting unique constraint exception. But, the first persist is successful. Could the first persist be rollbacked? Thanks.
Re: Two Persists within One Transactional Method [message #1696322 is a reply to message #1696246] Mon, 25 May 2015 15:27 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
IF they are in the same transaction, the entire transaction and all statements made within it rollback. If the first statement isn't being rolled back, you must be using separate transactions for your persist calls.
Re: Two Persists within One Transactional Method [message #1696627 is a reply to message #1696322] Wed, 27 May 2015 14:36 Go to previous messageGo to next message
HC Tsai is currently offline HC TsaiFriend
Messages: 2
Registered: May 2015
Junior Member
I assume that all of db operation should be rolled back. What's so the problem? Does EclipseLink support it?
Re: Two Persists within One Transactional Method [message #1697233 is a reply to message #1696627] Tue, 02 June 2015 15:38 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Yes, eclipseLink supports JTA. The problem is likely you have not setup EclipseLink to be within the JTA transaction, so that its statements are made on different connections outside of the transaction somehow. Check your settings and configuration, and turn on EclipseLink. JTA and JDBC logging to see what might be going wrong.

Previous Topic:Index on enumerated collection?
Next Topic:Exception when read Geometry type from Postgis
Goto Forum:
  


Current Time: Sat Apr 27 03:53:34 GMT 2024

Powered by FUDForum. Page generated in 0.03683 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top