Transaction management broken with Jahia 4.1 ???

[email protected]
Newsgroups gmane.comp.cms.jahia.devel
Message-ID <OFE5B41BCC.8B5928FB-ONC125704A.0035C483-C125704A.00382416@commaro.com>
Hello!

We are running Jahia on an application server (JBoss) and have the 
requirement to call EJBs within the engines via the EventListener. These 
EJBs must run within the same transaction context, so that if an exception 
occurs all database updates are rollbacked. We have solved this in a 
standard way by using the UserTransaction-Object, which is part of the JTA 
(Java Transaction API). In ConnectionDispenser we began a user-transaction 
on the first getConnection in a thread, on terminateConnection we issued a 
commit and on abortConnection a rollback.

We are using an Oracle database and got some lock-problems at the 
beginning. We have solved them by implementing a 
JahiaIncrementorsOracleDBService, which uses Oracle sequences instead of 
the JAHIA_AUTOIDS table, and by using this IncrementorService for all 
tables in Jahia (e.g. JAHIA_PAGES_DATA does not use the incrementor 
service in Jahia).

Now we are in the process to migrate to Jahia 4.1, but have got major 
problems with the latest ConnectionDispenser changes. Now you have a 
getConnection() and a getTxConnection(), whereas the getConnection() will 
also be transactional in case you configured db_transactions to true. 

Now you have two ThreadLocalConnectionInfo objects attached to the thread. 
So two connections and transactions might be attached to the same thread 
and when you call terminateConnection() you always simply terminate both. 
We now have a problem with this as JTA UserTransactions are not allowing 
two simultaneous transactions per thread.

The commit() has also been removed from terminateConnection(), so I ask 
myself, if Jahia 4.1 will work with db_transactions set to true. When is 
the commit done now?

I just wanted to ask if you will stick with this implementation or if you 
are going to change this bugs. This will help me decide, if I can still 
use the simple UserTransactions API or or if I have to use the more 
complex TransactionManager, but then I may even try to use the Transaction 
Management offered by the Spring Framework.

Greetings,
Benjamin Papez
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.