1 Reply Latest reply on Dec 9, 2002 12:41 PM by davidjencks

    Many to One  for Connections - ManagedConnection

    mnetship

      I would like to get one ManagedConnection for all connection requests within the same transaction. e.g. if i call cFactory.getConnection() twice in the same method/transaction i would like to get the same ManagedConnection.

      Well this is possible in some App Servers (e.g. Weblogic 7). because they match connections for requests from the same transaction.

      I am writting a JCA adapter for many application servers and I would like to stay as close to the JCA spec as possible.

      I hvae read a posting similar to this, but the solutions you have suggested are just work arounds.

      Please help.

        • 1. Re: Many to One  for Connections - ManagedConnection
          davidjencks

          You don't have any choice about it if your adapter supports only LocalTransaction: this will always happen. For an xa adapter, you can set the TrackConnectionsByTx attribute to true in the ConnectionManager mbean. This is available in at least 3.2 and 4: I don't remember if it's ported back to 3.0.x.

          Note that although setting this flag to true appears to be required to get many xa database drivers to work, the xa spec is fairly clear that any xa driver should work fine with it false. Setting it to true greatly reduces the possiblities of sharing physical connections among server threads, thus reducing scalability. However, setting it to true may reduce the traffic on the physical connections, as tx context switches are never sent.