Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » COBOL » When implementing custom sequence, getGeneratedVector is executed twice in JTA environment
When implementing custom sequence, getGeneratedVector is executed twice in JTA environment [message #1017101] Sat, 09 March 2013 09:49
Jon Miran is currently offline Jon MiranFriend
Messages: 1
Registered: March 2013
Junior Member
Hi all,

I am using eclipselink with postgresql in my web application. I wrote a sql function in my database in order to generate a specific sequence.

I implement a custom sequence by inherting the org.eclipse.persistence.sequencing.Sequence. I refered to the sample in http://wiki.eclipse.org/EclipseLink/Examples/JPA/CustomSequencing. But instead of using the getGeneratedValue() method I used the getGeneratedVector() and i set the allocation size to 1.

When the method getGeneratedVector() is executed i try to call the function in my database that returns the generated sequence value.

The problem is that when transaction type is JTA, the method getGeneratedVector() is executed twice: the first time when the entityManager.persist() is called and the second time when then transcation.commit is called. This porblem made a gab in my sequence.

I will be happy for any help in order to avoid calling twice to generate the value.
Previous Topic:COBOL Plug-in 3.0 Beta-2 is a good plug-in
Next Topic:toString helper
Goto Forum:
  


Current Time: Thu Apr 25 03:44:37 GMT 2024

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

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

Back to the top