-
1. Re: WrappedConnection NotSerializableException
adrian.brock Nov 22, 2004 6:59 PM (in response to garym)Use a local interface then you will get call-by-reference semantics
rather than call-by-value semantics.
It's all explained on the wiki including the JBoss4FAQ about the change to default
config to use call-by-value by default.
Passing managed connections between ejb contexts is usually a bad idea
anyway - unless you really know what you are doing - e.g. you are making
assumptions about the transaction assembly that may not be valid.
You are nearly always better off asking for a connection when you need it
and closing it once you have finished. This allows the greatest chance
of using resources efficiently and gives the server admin the most control.
Try the following piece of code that shows you always get the same connection
in the same transaction (regardless of who asks for it) with the default config.Connection c = dataSource.getConnection(); try { WrappedConnection wc = (WrappedConnection) c; System.out.println(wc.getUnderlyingConnection()); } finally { c.close(); }
-
2. Re: WrappedConnection NotSerializableException
garym Nov 23, 2004 11:11 AM (in response to garym)Adrian,
Thanks for the assistance.