[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Calling datasource.getConnection() after sessionContext.

AlexFDT do-not-reply at jboss.com
Sun Aug 3 06:52:25 EDT 2008


Peter, Jaikiran, 
thank you for you participation.

I have just tested it on jboss-4.2.3.GA. It throws the same exception.

Actually as it can be seen on "Fix Version/s" and "Subversion Commits" tab on https://jira.jboss.org/jira/browse/JBAS-1916 such behavior have been introduced in JBossAS-4.0.3RC1.

I think it would be not good to use an older version.

Jaikiran, i thought about changing order of statements. But there is a problem with it. The code which I presented here is a simplified concept. Real code is much more complicated. The application which i am adapting is quite a big one and I have already seen few different places in which it tries to get a connection after possible setRollbackonly(). And i am not sure about how many more such places there are.

I understand that setRollbackOnly() marks transaction for rollback. But i think that it should not be prohibited to take a connection and make queries (reading) even after marking it for rollback because it is marked but not actually rolled back at that moment.

As I can see for now I have 2 variants:
1. Try to override TxConnectionManager to make it providing the behaviour i need. I think there should be a way to make an overriding child class and to provide it for JBOSS to use through the configuration files. Or may be i have to change and recompile JBOSS library sources...
2. Try to find and reorganize all such places in my application.
It will be very hard because of complicated and undocumented code.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168322#4168322

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168322



More information about the jboss-user mailing list