Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » 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 04:49 Go to next message
Jon Miran is currently offline Jon Miran
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.
Re: When implementing custom sequence, getGeneratedVector is executed twice in JTA environment [message #1022571 is a reply to message #1017101] Fri, 22 March 2013 02:34 Go to previous message
Jordan alon is currently offline Jordan alon
Messages: 4
Registered: March 2013
Location: 1515 E Marine View Drive
Junior Member
I will ask my friend and tell you as soon as possible as he is an expert in these field.

You can go with lawyer boca raton
Previous Topic:COBOL Plug-in 3.0 Beta-2 is a good plug-in
Next Topic:Freecobol compilers
Goto Forum:
  


Current Time: Mon Oct 07 05:50:04 EDT 2013

Powered by FUDForum. Page generated in 0.50608 seconds