Can you provide any more concrete information about what is happening, perhaps a log excerpt and anything you know about the actions the toplink code does? What you say doesn't make any sense to me yet, because jboss never closes connections for you, ever. In fact it is a spec requirement that you can leave them open between method calls, and my tests indicate this works.
Also, closing a connection does not have any relationship to committing a transaction the connection may be enrolled in.
I've attached a trace which shows what happens in one transaction, with toplink logging and trace logging enabled on tm, resource, and ejb.
Eventually, if I run enough transactions, I wind up with the following exception:
org.jboss.util.NestedSQLException: No ManagedConnections Available!; - nested throwable: (javax.resource.ResourceException: No ManagedConnections Available!)
at oracle.toplink.jndi.JNDIConnector.connect(Unknown Source)
at oracle.toplink.sessions.DatabaseLogin.connect(Unknown Source)
My current workaround involves letting TopLink do its own connection pooling, but I'd much rather leave that to the app server.
Thanks for your assistance,
This is the exact same problem I am having, but this thread died without an explanation of the fix.
What was the trick here? How did you modify the TopLink JTSSynchronizationListener to play nice with JBoss?