I have to make a change to use Oracle Database 11g Express instead of PostgreSQL 9.5.4. We use JPA, Hibernate 3.5.0-Final, Java 8, JBoss, so we have:
entityMgr.open();
entityMgr.begin();
entityMgr.merge(action);
//entityMgr.flush(); // I have tried with and without - same result
//entityMgr.getTransaction().isActive(); // returns true
Object transactionId = entityMgr.createNativeQuery("SELECT DBMS_TRANSACTION.LOCAL_TRANSACTION_ID FROM dual").getSingleResult();
...
For some reason transactionId is always null. From what I read transactionId is null if there is no transaction, however from my understanding there is transaction running (if uncommented transaction.isActive() returns true). We are connected to Oracle db as other operations before this one are working fine. When we used Postgress before it worked properly when the last line was replaced with below:
Object transactionId = entityMgr.createNativeQuery("SELECT txid_current()").getSingleResult();
What is wrong with my code, how can I get actual transactionId in Oracle please ?