Menu

#622 reuse of destroyed connection

v3.0 Rabbit Hole
closed-fixed
JBossCX (83)
5
2002-06-29
2002-06-21
No

I'm seeing reuse of a destroyed ManagedConnection in
the 3.0 product. A connection is destroyed, but then
later is passed to the ManagedConnectionFactory's
matchManagedConnections method. This is a minor
point to me since I can allocate a new low-level
connection for the mc, but it doesn't seem like it's in the
spirit of the JCA spec.

"Connection Destroy
To manage the size of the connection pool, the
application server can call ManagedConnection.destroy
method [sic] to destroy a ManagedConnection. A
ManagedConnection instance handles this method call
by closing the physical connection to the EIS instance
and releasing all system resources held by this instance.
The application server also calls
ManagedConnection.destroy when it reeives a
connection error event notification that signals a fatal
error on the physical connection"

It was in the latter context that I saw a connection be
destroyed and later reused. If the container thinks the
connection is damaged, it seems unwise to put it back
in the pool and try to reuse it. Instead, why not clobber it
and, if you have to, associate any cached handles with
another connection?

12:20:25,840 INFO [Facets] [06/20/02 12:20:25.839
PDTRMI TCP Connection(5)-10.80.10.114]
#mc.notifyListeners# connection error occurred

^^^^^^ the jca connection notifies the container of an
exception

12:20:25,841 INFO [Facets] [06/20/02 12:20:25.840
PDTRMI TCP Connection(5)-10.80.10.114]
#mc.cleanup# CC2( PM 198 (workspace 3) (inactive
manual txn) inJTx=false)
12:20:25,842 INFO [Facets] [06/20/02 12:20:25.842
PDTRMI TCP Connection(5)-10.80.10.114]
#mc.destroy# CC2( PM 198 (workspace 3) (inactive
manual txn) inJTx=false)

^^^^^^ the container destroys the connection

12:20:25,967 INFO [Facets] [06/20/02 12:20:25.966
PDTRMI TCP Connection(5)-10.80.10.114] #xa.forget
[hash=2346814,session=PM 198 (workspace 0)
(shutdownPending closed txn)] xid=XidImpl
[FormatId=257, GlobalId=dirt//11, BranchQual=1]
trs=resource
PDT]::::: Bean is Getting A Connection
12:20:26,431 INFO [Facets] [06/20/02 12:20:26.427
PDTRMI TCP Connection(6)-10.80.10.114] Establishing
new Facets session for connection CC2( PM 198
(workspace 0) (shutdownPending closed txn)
inJTx=false)
12:20:26,432 INFO [Facets] [06/20/02 12:20:26.432
PDTRMI TCP Connection(6)-10.80.10.114]
#cf.matchManagedConnetions# created new session for
CC2( PM 199 (workspace 3) (inactive manual txn)
inJTx=false)
12:20:26,434 INFO [Facets] [06/20/02 12:20:26.433
PDTRMI TCP Connection(6)-10.80.10.114] [Facets]
using pooled connection CC2( PM 199 (workspace 3)
(inactive manual txn) inJTx=false)

^^^^^^matchManagedConnections is invoked with the
destroyed ManagedConnection in the selection set

12:20:26,435 INFO [Facets] [06/20/02 12:20:26.435
PDTRMI TCP Connection(6)-10.80.10.114]
#mc.getXAResource# CC2( PM 199 (workspace 3)
(inactive manual txn) inJTx=false)
12:20:26,436 INFO [Facets] [06/20/02 12:20:26.436
PDTRMI TCP Connection(6)-10.80.10.114] #xa.start
[hash=2720035,session=PM 199 (workspace 3)
(inactive manual txn)] xid=XidImpl [FormatId=257,
GlobalId=dirt//14, BranchQual=1]
12:20:26,439 INFO [Facets] [06/20/02 12:20:26.438
PDTRMI TCP Connection(6)-10.80.10.114]
#mc.getConnection# CC2( PM 199 (workspace 3)
(active manual txn) inJTx=true)

Discussion

  • Bruce Schuchardt

    Logged In: YES
    user_id=109768

    A connection is returned to the pool when it's closed. If the
    connection gets a subsequent error the XA connection
    manager destroys it but doesn't remove it from the connection
    pool.

     
  • David Jencks

    David Jencks - 2002-06-25

    Logged In: YES
    user_id=60525

    I've checked in a fix to Branch_3_0 and HEAD. Can you test
    it? If it works I will close this bug.

    Thanks
    david jencks

     
  • David Jencks

    David Jencks - 2002-06-25
    • assigned_to: nobody --> d_jencks
    • status: open --> open-fixed
     
  • David Jencks

    David Jencks - 2002-06-29
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.