Hi,
I create a method:
and start with
...
User Transaction transaction = Transaction.instance();
transaction.begin();
Calling another method in another class which performs the actual work.
---------------------------------------------------------
Another class:
@In(create = true)
private EntityManager entityManager;
Another method:
...
Work
..
entityManager.persist(aEnity);
entityManager.flush();
---------------------------------------------------------
transaction.commit();
Behavior:
When the oc4j Transaction Level is set to "Local Transaction " the entityManager.flush(); commits the data to the database.
When the oc4j Transaction Level is set to "Global & Local Transaction " the entityManager.flush(); does not commits the data to the database but the transaction.commit(); does .
Can anyone explain this behavior?
|
``
|