Bugs item #773839, was opened at 2003-07-18 18:26
Message generated for change (Comment added) made by ejort
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=773839&group_id=22866

>Category: JBossCX
Group: None
Status: Open
>Resolution: Works For Me
Priority: 5
Submitted By: gui (janssk1)
>Assigned to: Adrian Brock (ejort)
Summary: Exception handling in JCA adapter

Initial Comment:
Hello, 

I have some issues with the exception handling of 
exceptions thrown by a custom JCA adapter. 

If an exception occurs during the creation of a managed 
connection, this is handled correcly (the managed 
connection is removed from the pool)

However, if an exception occurs during retrieval of a 
handle (getConnection()), the managed connection is 
not given back to the pool (i think that's a bug). The 
availbleconnectioncount is decreased but there is not 
way to release the managed connection since the 
creation of the handle failed. To prevent this behavior, i 
am forced to send a 'errorOccured' event before 
throwing an exception during creation of a handle. But 
sending this event will destroy the underlying managed 
connection, which is not exactely what i want. I want 
the managed connection to be returned to the pool if 
the getConnection throws an exception. This prevents 
excessive destroying of (wellbehaved) managed 
connections. 


Another issue is related to closing a 'destroyed' 
connection handle. Suppose a major error occurs on the 
underlying managed connection during some operation 
on a handle. According to the spec, i send a notifyError 
to let the container know that this connection is no 
longer useable and throw an exception to the user code.
This user code will typically notice the exception and 
close the handle. But then there's an issue:
The close operation is called on a handle of a 'destoyed' 
managed connection. Should i in the close of the handle 
still send the connectionClosed event ?
If i do it, jboss complains (thows an exception) about 
trying to close a destoyed connection. If i don't, 
i get the 'please to your own housekeeping' message. 

I think jboss should *or* automatically close the handle 
if a fatal error occurs *or* still allow the 
connectionClosed event to be send. 


Any comments are highly appreciated..

----------------------------------------------------------------------

>Comment By: Adrian Brock (ejort)
Date: 2003-07-21 01:05

Message:
Logged In: YES 
user_id=9459

Hi,

First, which version of jboss are you using?

Your first problem sounds like the semaphore leak fixed in
3.0.8/3.2.2RC1
where an unchecked throwable was not handled correctly by
the pool.

For the second problem, I cannot find the exception you
describe in the
current source, can you post the stacktrace?
I have also added some tests to the testsuite
for connection failures that destroys the connection.
A subsequent invocation of connectionClosed() does not cause
the problems you describe.

Perhaps you can compare your resource adapter with
the one in the jboss testsuite and explain what
changes are required to reproduce your problem?
NOTE: My new tests may not appear for 24hrs on the web
interface.
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosstest/src/main/org/jboss/test/jca/adapter/?only_with_tag=Branch_3_2

Regards,
Adrian

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=773839&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to