Friday, November 12, 2010

Activation creates duplicate row when primary key is populated through DB sequence (Fixed in

We are testing if our Application Module is Activation-Safe according to:
Fusion Developer's Guide for Oracle ADF
40.10 Testing to Ensure Your Application Module is Activation-Safe
And we have many problems.
1 of them is that when we press createInsert instead of creating a new row we get the same row 2 times.

I reproduce it in a simple test case from HR schema with Countries and Locations Entities.
In Locations Entity create method I populate primary key from sequence

protected void create(AttributeList attributeList) {
SequenceImpl s = new SequenceImpl("LOCATIONS_SEQ",getDBTransaction());

As in
Fusion Developer's Guide for Oracle ADF
4.12.5 Assigning the Primary Key Value Using an Oracle Sequence

I check Activation-Safe by un-checking Enable Application Module Pooling in configuration.

I have a simple master Countries form and detail Locations table with CreateInsert button.
When I press CreateInsert for first time a new row is created with new sequence as locationId and I fill also other fields with values.

When I press CreateInsert again instead of getting a new rows I get 2 same rows as the first and both of them has the same new sequence as primary key.!!??

After that whatever I do on the page I get null pointer exception. (NullPointerException)
Is this a bug?

Test case:


  1. Looks like a pretty serious bug to me.

    Once the AM is disconnected from the database connection - despite of the fact that your AM configuration is set otherwise, activation never restores the database connection to its previous state.

  2. It's a nasty bug in Just tested it with and it works fine.

  3. Further to my comments above, if you look at the passivation data produced by versions and you will see that the Entities are NOT passivated (there is no EO tag in the passivated data)!

  4. Hi Me too get same issue as dbsequence generated duplicate values...

    Can you please advice me on how to resolve this issue.


    1. Hello this issue concerned an old version of jdeveloper you should upgrate to latest versions if you are still there.