Hello, I haven't got any experience in Transactions and I would appreciate it if someone could give me a hint:
I have noticed in the OpenKM source code that you implement transactions when working with repository or communicating with database using Hibernation.
Let's say that I have a method that does these actions:
-query the database using jdbc connection (not Hibernate)
-update the database using jdbc connection (not Hibernate)
-grant a user on a document using OKMAuth class
-revoke an other user from the same document using OKMAuth class
Can I include all these things inside a single global transaction so that If something goes wrong everything will rollback?
Is OKMAuth compatible with com.openkm.util.Transaction? Can i do something like this? :
Sorry for the sillyness of my question but I have only worked with local database Transactions. JTA is something new for me and I am trying to figure out how your transactions work
I have noticed in the OpenKM source code that you implement transactions when working with repository or communicating with database using Hibernation.
Let's say that I have a method that does these actions:
-query the database using jdbc connection (not Hibernate)
-update the database using jdbc connection (not Hibernate)
-grant a user on a document using OKMAuth class
-revoke an other user from the same document using OKMAuth class
Can I include all these things inside a single global transaction so that If something goes wrong everything will rollback?
Is OKMAuth compatible with com.openkm.util.Transaction? Can i do something like this? :
Code: Select all
If not, is there a way I can make my jdbc connector and OKMAuth be handled from a global transaction manager using an XA interface or something like this?XASession session = (XASession) JCRUtils.getSession();
Transaction t = new Transaction(session);
t.start();
OKMAuth.getInstance().grantUser()...
OKMAuth.getInstance().revokeUser()...
t.end();
t.commit();
Sorry for the sillyness of my question but I have only worked with local database Transactions. JTA is something new for me and I am trying to figure out how your transactions work