Re: [JBoss-user] Transactional JCA Connections are closed mid-transaction
On Wed, 18 Jun 2003 07:42, David Jencks wrote: > The spi LocalTransaction or an xa transaction is associated with the > ManagedConnection. If you use the local tx ConnectionManager or the xa one > with track-connections-by-tx all connection handles you obtain within a > transaction will be associated with the same ManagedConnection instance and > thus will be within that transaction. Thanks for that David. On earlier advise (thanks Igor) I did some reading of the JCA specs and had come to (something like) this conclusion, and it makes a lot of sense now that I understand it. Thanks for the pointer to "track-connections-by-tx". brian... --- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Transactional JCA Connections are closed mid-transaction
How are you controlling transactions? I suggest you use UserTransaction or, better still, CMT. I think there are no guarantees about using an adapters cci LocalTransaction across ejb method calls. The spi LocalTransaction or an xa transaction is associated with the ManagedConnection. If you use the local tx ConnectionManager or the xa one with track-connections-by-tx all connection handles you obtain within a transaction will be associated with the same ManagedConnection instance and thus will be within that transaction. Using UserTx or CMT you should be able to obtain and close connection handles at any time with no effect on which transaction is in effect. david jencks /** * David Jencks * Partner * Core Developers Network * http://www.coredevelopers.net **/ On 2003.06.10 22:27 Brian Wallis wrote: > On Wed, 11 Jun 2003 11:16, Brian Wallis wrote: > > > Searched the source instead. In jboss-jca.sar/META-INF/jboss-service.xml > is > > the configuration of the CachedConnectionManager and the parameter > > SpecCompliant is set to false. I think that if I make it true then the > > connections will not be closed. ie: > > And it seems to work. My connections remain open for the duration of the > transaction and I close them in afterCompletion() on the bean. > > Thanks for the help, but I'm still not sure if I'm doing the right thing > here > wrt transactions and JCAs. > > brian... > > > > --- > This SF.net email is sponsored by: Etnus, makers of TotalView, The best > thread debugger on the planet. Designed with thread debugging features > you've never dreamed of, try TotalView 6 free at www.etnus.com. > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > > --- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Transactional JCA Connections are closed mid-transaction
On Wed, 11 Jun 2003 11:16, Brian Wallis wrote: > Searched the source instead. In jboss-jca.sar/META-INF/jboss-service.xml is > the configuration of the CachedConnectionManager and the parameter > SpecCompliant is set to false. I think that if I make it true then the > connections will not be closed. ie: And it seems to work. My connections remain open for the duration of the transaction and I close them in afterCompletion() on the bean. Thanks for the help, but I'm still not sure if I'm doing the right thing here wrt transactions and JCAs. brian... --- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Transactional JCA Connections are closed mid-transaction
Brian Wallis wrote: On Wed, 11 Jun 2003 09:46, Brian Wallis wrote: It closes the logical connection. But for me it makes no difference, I have no way of getting back a logical connection to the same physical connection. I'll have a search of the list. Could take a while, the search on sourceforge lists doesn't seem to work very well. It never matches anything if I type two or more words :-( thanks for the pointer. Searched the source instead. In jboss-jca.sar/META-INF/jboss-service.xml is the configuration of the CachedConnectionManager and the parameter SpecCompliant is set to false. I think that if I make it true then the connections will not be closed. ie: false Not sure I understand the comment in that configuration. Yes, that the parameter. I'm still not sure about the original problem though. Am I correct in wanting these logical connections to remain open between calls when I am within a transaction? The bean cannot be passivated while a transaction is current so it should be safe to keep them as local state in the stateful bean. Yes and no. According to the spec, application server is allowed to do pretty cool (or weird) things with logical connection handlers, especially if EJB keeps handlers between method calls. For example, app server can detach logical handler from its physical connection and attach it to another physical connection later. You probably want to read parts of JCA 1.0 that talk about connection and transaction management. --- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Transactional JCA Connections are closed mid-transaction
On Wed, 11 Jun 2003 09:46, Brian Wallis wrote: > It closes the logical connection. But for me it makes no difference, I have > no way of getting back a logical connection to the same physical > connection. > > I'll have a search of the list. Could take a while, the search on > sourceforge lists doesn't seem to work very well. It never matches anything > if I type two or more words :-( > > thanks for the pointer. Searched the source instead. In jboss-jca.sar/META-INF/jboss-service.xml is the configuration of the CachedConnectionManager and the parameter SpecCompliant is set to false. I think that if I make it true then the connections will not be closed. ie: false Not sure I understand the comment in that configuration. I'm still not sure about the original problem though. Am I correct in wanting these logical connections to remain open between calls when I am within a transaction? The bean cannot be passivated while a transaction is current so it should be safe to keep them as local state in the stateful bean. brian... --- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Transactional JCA Connections are closed mid-transaction
On Wed, 11 Jun 2003 00:31, Igor Fedorenko wrote: > What do you mean by "closes the JCA connection"? JCA has a clear > separation between logical connection handlers and physical connections > to underlying EIS. By default JBoss automatically closes logical > handlers left open after return from a method call, but there was a way > to turn this behaviour off. Unfortunately I cannot remember exact > syntax, so you need to search archive of this list. G'day Igor, It closes the logical connection. But for me it makes no difference, I have no way of getting back a logical connection to the same physical connection. I'll have a search of the list. Could take a while, the search on sourceforge lists doesn't seem to work very well. It never matches anything if I type two or more words :-( thanks for the pointer. brian... --- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Transactional JCA Connections are closed mid-transaction
Brian, What do you mean by "closes the JCA connection"? JCA has a clear separation between logical connection handlers and physical connections to underlying EIS. By default JBoss automatically closes logical handlers left open after return from a method call, but there was a way to turn this behaviour off. Unfortunately I cannot remember exact syntax, so you need to search archive of this list. Brian Wallis wrote: I have a design where I am connecting to external EIS using a transactional JCA that I have written and I am using the JCA for multiple commands within a transaction from a transactional stateful session bean. The scenario involves two session beans, one stateless and one stateful, and the JCA. - The stateless session bean (within in one method) that sets up a transaction and calls txn.begin(). - It then creates and calls the stateful session bean - The stateful session bean creates a connection to the JCA (getConnection() on the factory). - The stateful bean then creates an interaction, sets up the command and then calls execute(). - The stateful bean then returns to the caller (the stateless bean) which will then call another method on the stateful bean, all within the same transaction. Unfortunatly, on return to the stateless bean the runtime closes the JCA connection. This seems wrong to me. The external transaction management is done within the JCA ManagedConnection object but if the connection is closed each time how can I successfully do this management? I'm not guaranteed that I'll even get the same connection back again next time. I really need to keep that connection open for the duration of the transaction. Am I misunderstanding something here or is there some configuration setting I'm missing. brian wallis... --- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Transactional JCA Connections are closed mid-transaction
I have a design where I am connecting to external EIS using a transactional JCA that I have written and I am using the JCA for multiple commands within a transaction from a transactional stateful session bean. The scenario involves two session beans, one stateless and one stateful, and the JCA. - The stateless session bean (within in one method) that sets up a transaction and calls txn.begin(). - It then creates and calls the stateful session bean - The stateful session bean creates a connection to the JCA (getConnection() on the factory). - The stateful bean then creates an interaction, sets up the command and then calls execute(). - The stateful bean then returns to the caller (the stateless bean) which will then call another method on the stateful bean, all within the same transaction. Unfortunatly, on return to the stateless bean the runtime closes the JCA connection. This seems wrong to me. The external transaction management is done within the JCA ManagedConnection object but if the connection is closed each time how can I successfully do this management? I'm not guaranteed that I'll even get the same connection back again next time. I really need to keep that connection open for the duration of the transaction. Am I misunderstanding something here or is there some configuration setting I'm missing. brian wallis... --- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user