We have recently decided to move to JTA and OracleXADataSources with Oracle10g, hibernate 3.2.1 and Atomikos Transaction manager.
We managed to make all the necessary changes, but I am still bunging my head against the following problem. I understand hibernate uses global temporary tables to deal with bulk update/ bulk deletes in the case of inheritence.
Well, in my case I am trying to issue on simple update through:
String sql = "update " + childClass + " o " +
"set " +
"o.prop1 = :prop1 " +
"where o = :object";
.In the process of running this HQL query , hibernate fails to create that temp table.
In the AbstractStatementExecutor.createTemporaryTableIfNecessary(), the executeUpdate fails with the following error:
ORA-02089: COMMIT is not allowed in a subordinate session
The corresponding SQL for the temp table was:
create global temporary table HT_CHILDCLASS (ccID CHAR(32) not null) on commit delete rows
I read through the forum and found couple of interesting posting, this one (
http://beehive.apache.org/docs/1.0.2/sy ... guide.html) was especially useful as I know understand the problem is due to the 'on commit delete rows' being issued while using and XADatasource and JTA. The articles suggests to suspend the transaction, run the statement and resume again the transaction.
I looked at the hibernate code again, and this is what you guys are doing in the Isolater.delegateWork() method.
Any thought/idea on to fix this problem. Could it be the JDBC driver?? I am using the ojdbc14.jar for oracle10g.
I have also tried with hibernate 3.2.4SP1, with no success.... Note that the same piece of code was working perfectly fine, prior to us moving to JTA. (I.e: the temp tables were created fine)