You should be able to use the LocalTxConnectionManager. What are the problems you are experiencing with autocommit? Do they occur with other dbs such as hypersonic? Please try to supply enough information so I have a reasonable chance of figuring out what is wrong.
Thanks, I can get it to work with the LocalTX as you said. I have each session bean set up with NoTransaction in the ejb-xml file.
I did have to comment out some of the autocommit(true) statements in my code though; otherwise I was getting an SQLException = sql is not valid. Not sure why, but still need to look into it further to ensure my ejb.xml file is configured correctly.
BTW, what/when should the NoTXConnectionManager be used?
You should use the NoTxConnectinManager if your resource adapter doesn't support any sort of transactions.
The Local wrapper should get your connections into autocommit mode if you use them outside a managed transaction and don't call setAutoCommit(false) on them. Calling setAutoCommit(anything) inside a managed tx should raise an exception. I wouldn't expect calling setAutocommit(true) outside a managed tx to cause any problems.
If no transaction is specified will connection pooling still work or is this tied to the connection manager ?
I am doing this from a servlet rather than a bean but I'm assuming if I specify it in the web.xml (or jboss-web.xml ?) the same rules should apply ?
Connection pooling should work even without a managed transaction. The connection should have autocommit true by default (unless you set it differently) outside a managed transaction. If you are using UserTransaction you should not need to ever set autocommit to anything.
That being said, I don't think I have any tests for the local wrapper/cm outside managed transactions. So if there are problems please let me know, the ideal way to let me know being with a junit test case ready to go in the test suite;-)
When I tried to deploy with a notx manager it doesn't get completely deployed.
The notxds section of the mbean gives a warning that is does not implement any service methods;
lookups to the jndi don't find anything (and nothing is in the jndi viewer). ie. the bind is failing.
The bind however works with a connection manager enabled service, although I can't use it as from a web servlet;
it seems that nothing starts the two phase transaction when used in a web servlet. Can this transaction be manually
started ? (a user transaction begin does not seem to do it).
I've based my service file off one you put on a list, will this work on RC2 or does it need the CVS version ? I've
included the service file just in case there is something really obvious in it.
Once I can get it to deploy happily I'll write some test cases for it :)
<?xml version="1.0" encoding="UTF-8"?>
<!--make the rar deploy! hack till better deployment-->
<depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
<!--criteria indicates if Subject (from security domain) or app supplied
parameters (such as from getConnection(user, pw)) are used to distinguish
connections in the pool. Choices are
ByContainerAndApplication (use both),
ByContainer (use Subject),
ByApplication (use app supplied params only),
ByNothing (all connections are equivalent, usually if adapter supports
<!-- attribute name="SecurityDomainJndiName">java:/jaas/DefaultDbRealm</attribute -->