This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm trying to write a Resource Adapter (Connector), and would appreciate hints on the relation between ManagedConnection and the underlying "Connection handle" (namely, the one returned by ManagedConnection.getConnection()).
It is possible to have multiple connection handles associated with the same ManagedConnection. An application server might call getConnection multiple times to enable sharing of a ManagedConnection across multiple connection handles. As a result, it is important that no states are kept in the connection handles. They should be treated as a stateless pipe, or pointer, to the ManagedConnection
Does that mean the same ManagedConnection should store multiple Connection "handles" at the *same time* ? Something like:
If so, what's the motivation? I mean, I understand the container (and its ConnectionManager) use ManagedConnections to handle pooling, transactions, and getting ConnectionEvents. But for this, isn't it enought for each ManagedConnection to hold a single connection handle ? (I realize container's behaviour is vendor-specific, but I'm looking for some reasonable scenario, or example, where it would make some sense).