Hi again, I dont know if I have al possible error conditions in my head, and my excperiences are based on the 2.4.3 code.
Also remember that the current JMS RA does not have any support for reconnect or exception listener. What we basically want is failover, i.e the JMS provider in this case (or a db I guess in other cases) has gone down and come up again. 1. The case where the EIS is down when the client is doing a call should be transparent. The client gets an exception and the mc uses the listener to invalidate that mc in the pool. Things gets more complicated when the EIS has come back. One verry important restriction here is that the spec says that an instance of an mc must allways return the same XAResource! 2. The client gets an handle, probably from the pool. a) If the RA does not have an asynchronous exception mechanism (as JMS have), we are in big trubble. The server side JCA stuff will macth an existring mc, will atach a listener and get the XAResource, and if this is correctly done that XAResource will actually not be valid any more, something like this will be reported: [SMSTransport] XAException: tx=XidImpl [FormatId=257, GlobalId=linutv1//10, BranchQual=] errorCode=XAER_NOTA [SMSTransport] javax.transaction.xa.XAException Since we have, per spec to return the same XAResource for a mc we are not allowed to do magic here, i.e check if the resource has bee invalidated due to connection outake and make a new connection and return a new and valid XAResource. What could we do here: verry hard to say: In the API it says the getXAResource may throw a javax.resource.spi.ResourceAdapterInternalException to indicate that the mc is not valid any more. This could perhaps be used to invalidate the mc, and let the JCA stuff simple create a new one. b) If it has asynchronous support the listener API could be used to propagate the invalidation. I do not know if it is reallt spec compliant not to set the listener every time the mc is taken from the pool, but the way you have done it seems to do it easy to have asynchronous error reporting/invalidation. I guess it is also important for an XAResource that is invalid in the way described before is never enlisted in the tm. What I am trying to say is simply this: XA capable mc:s for wich the connection has gone down, but the EIS has come up agains, needs to invalidated in a transparent way for the client using it. //Peter On 24 Apr, David Jencks wrote: > On 2002.04.24 15:48:16 -0400 [EMAIL PROTECTED] wrote: >> On 24 Apr, David Jencks wrote: >> > So the problem you had was that ManagedConnection.getXAResource was >> called >> > before ManagedConnection.addConnectionEventListener? It is always >> > dangerous to claim things about code, but I am sure that >> > ManagedConnection.addConnectionEventListener is always called before >> > ManagedConnection.getXAResource in the new implementation. >> > >> > When connectionErrorOccurred is called, the ManagedConnection is >> destroyed >> > and removed from the pool. IMO with a compliant adapter, this will >> result >> > in all the connection handles associated with that ManagedConnection >> > becoming unattached to any ManagedConnection. In the new >> implementation, >> > if you cache connection handles accross method invocations, in the next >> > invocation these handles will be associated with a presumably valid >> > ManagedConnection obtained from the pool or newly created. Again IMO >> the >> > adapter should throw enough of an exception to roll back the current tx >> if >> > the physical connection dies. >> >> This sounds OK. If you try to get an mc, and these things happens (i.e >> whan you add the listener add will emediately be called at >> connectionErrorOccurred, what happends then, do you try to get a new mc >> from the pool (which probaly are dead all of them), or do you create a >> new mc. > > I haven't thought about these asynchronous possibilities before. The > adapter is supposed to call the connectionErrorOccurred on the listeners > and then through an exception to the client. Is there any way to do that, > even when you know there is a client? I'd imagine that when there isn't, > no problem. > >> >> The basic problem here is that when using an ExceptionListener with JMS >> the connectio error can happen any time. If the mc is in use, it will be >> noticed and all is fine, but if the mc is in the pool, the only way it >> can raise the error is to wait for a listener to become added when it is >> above to be moved from the pool into an active state. > > Again, I haven't thought through this asynchronous case, but it might work > fine as is. In the new system, a ManagedConnection gets one > ConnectionEventListener throughout its entire lifespan, and keeps it while > it is pooled. I haven't checked my destroy/kill logic, but it should be > possible to deal with these events properly even when the managed > connection is in the pool. > > Is there any chance you have tests for this behavior? Or any more bad cases > to be aware of? > > This is getting interesting! > > Thanks > david jencks > >> >> //Peter >> > >> > Are there some other issues I should look at? Have I missed something? >> > >> > thanks >> > david jencks >> > >> > On 2002.04.24 11:07:07 -0400 Peter Antman wrote: >> >> On 24 Apr, David Jencks wrote: >> >> > On 2002.04.24 10:14:20 -0400 Peter Antman wrote: >> >> > <big snip>> >> >> >> I thing JBoss is the only appserver where JMS XA sending is not >> tied >> >> to >> >> >> the server nor to a specific JMS provider, but perhaps at a price: >> >> close >> >> >> your sessions!! Otherwise it works nice, I think and what should be >> >> >> fixed are some problems with the app server side of the JCA >> >> >> implementation. >> >> > >> >> > What are they? Can you be more specific? Any tests? Are the >> problems >> >> still >> >> > present with the all-new jca implementation in jboss 3? >> >> >> >> As I wrote in an earlier mail: >> >> >> >> The real problem with the RA is that it is not failsafe. In itself >> that >> >> is pretty easilly fixed by adding an ExceptionListener, but it does >> not >> >> work with the (old?) jbosspool code: >> >> >> >> First it takes the XAResource before it adds a listener, but does not >> >> handle when it gets an invalid XAResource due to a connection failour >> >> (and by that time it is to late to transmit the error via the >> listener). >> >> >> >> Then one can allways wonder about this: if we have a number of pooled >> >> JMS session, all will become invallid when the connection has gone >> down >> >> (the XAResource is connected to a ManagedConnection and must allways >> be >> >> the same for each mc, but this is not possible if the >> connection/session >> >> is reestablished, i.e all outsating mc with a broken connection must >> be >> >> marked as invalid). But there is not way to know if the pool is just >> >> trying pooled mc:s or are actually returning new one, which makes it >> >> impossible to really know from the (XA)ConnectionManager how many >> times >> >> it should retry. >> >> >> >> At least this is the case in the 2.4 line (I think). >> >> >> >> And I also had to write: I unfortunately do not have the time to test >> >> this out in the near future (next couple of weeks), especially not >> with >> >> the 3.0 line. >> >> >> >> Sorry. >> >> //Peter >> >> > >> >> > Thanks >> >> > david jencks >> >> >> >> >> >> //Peter >> >> >> > >> >> >> >>I could not come up with a good solution on this problem, except >> >> >> >>documenting how to use it. If someone can find a solution, pleas >> >> >> commit >> >> >> >>it. >> >> >> >> >> >> >> >>//Peter >> >> >> >> > >> >> >> >> > Anyone have some time to check this out and look over what >> needs >> >> to >> >> >> be >> >> >> >>done? >> >> >> >> > >> >> >> >> > Thanks, >> >> >> >> > >> >> >> >> > --jason -- ------------------------------------------------------------ Peter Antman Chief Systems Architect, Business Development Technology in Media, Box 34105 100 26 Stockholm WWW: http://www.tim.se WWW: http://www.backsource.org Email: [EMAIL PROTECTED] Phone: +46-(0)8-506 381 11 Mobile: 070-675 3942 ------------------------------------------------------------ _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
