<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=1 face="Times New Roman"><span style='font-size:
9.0pt'>Hi<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>The url
below says how to extract a Oracle type Connection from JBOSS Wrapper <br>
<a href="http://forums.oracle.com/forums/thread.jspa?messageID=1384788">http://forums.oracle.com/forums/thread.jspa?messageID=1384788</a><br>
No problem is getting the connection, but Do Not know how to close the same for
the obtained connection to be returned<br>
The code is as given below<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>private
WrappedConnection WCP = null;<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>/**<br>
&nbsp;* Singleton process<br>
&nbsp;*/<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>public
static DBConnectionManager getInstance() throws InfinetException {<br>
&nbsp; &nbsp;if (instance == null) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; synchronized
(DBConnectionManager.class) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if
(instance == null) {instance = new DBConnectionManager(); }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; return instance;<br>
}<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>/**<br>
* Get connection<br>
&nbsp;*/<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>public
Connection getConnection()throws InfinetException{<br>
&nbsp; Connection connx = null;<br>
&nbsp; Connection underlyingConn = null;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;try {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
connx = ODS.getConnection();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
WCP = (WrappedConnection)connx;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
underlyingConn = WCP.getUnderlyingConnection();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
connx =&nbsp; (OracleConnection)underlyingConn;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} catch (SQLException sqlex) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sqlex.printStackTrace();<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp; return connx;<br>
&nbsp; }<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>/**<br>
&nbsp;* Free connection<br>
&nbsp;*/<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>public
void freeConnection(Connection con) throws InfinetException {<br>
&nbsp; System.ou.println(&quot;RELEASING THE USED CONNECTION TO POOL&quot;);<br>
&nbsp; try {<br>
&nbsp;&nbsp;&nbsp;&nbsp; //@IMP JBOSS does not require this connection to close<br>
&nbsp;&nbsp;&nbsp;&nbsp; //con.close();<br>
&nbsp;&nbsp;&nbsp;&nbsp; //Close WRAPPER Connection<br>
&nbsp;&nbsp;&nbsp;&nbsp; WCP.close();<br>
&nbsp; }catch (Exception e) {<br>
&nbsp;&nbsp;&nbsp; System.out.println(&quot;CAN'T CLOSE CONNECTION FOR POOL
&quot;);<br>
&nbsp;&nbsp;&nbsp; e.printStackTrace();<br>
&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
}<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>Oracle-ds.xml
is as follows<br>
&lt;local-tx-datasource&gt;<br>
&lt;jndi-name&gt;jdbc/ORACLESCHEMA1&lt;/jndi-name&gt;<br>
&lt;connection-url&gt;jdbc:oracle:thin:@172.16.17.70:1521:SCHEMA1&lt;/connection-url&gt;<br>
&lt;driver-class&gt;oracle.jdbc.OracleDriver&lt;/driver-class&gt;<br>
&lt;user-name&gt;SCHEMAUSERID&lt;/user-name&gt;<br>
&lt;password&gt;SCHEMAPASSWD&lt;/password&gt;<br>
&lt;min-pool-size&gt;10&lt;/min-pool-size&gt;<br>
&lt;max-pool-size&gt;60&lt;/max-pool-size&gt;<br>
&lt;track-statements&gt;false&lt;/track-statements&gt;<br>
&lt;metadata&gt;<br>
&lt;type-mapping&gt;Oracle9i&lt;/type-mapping&gt;<br>
&lt;/metadata&gt;<br>
&lt;/local-tx-datasource&gt;<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>>From jmx-console
&nbsp;&#8220;name=jdbc/ORACLESCHEMA1,service=ManagedConnectionPool&#8221; <br>
We observe that &nbsp;&nbsp;with in 10 minuts &#8220;</span></font><font
size=2><span style='font-size:10.0pt'>AvailableConnectionCount</span></font>&#8221;
<font size=2><span style='font-size:10.0pt'>was&nbsp; become &#8216;0&#8217;<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>Any help
would be appreciated<br>
<br>
SPEC<br>
JBOSS 4.2.1<br>
ORACLE DB : 10G DB<br>
jar : ojdbc14.jar<br>
j2sdk 1.4 for development<br>
j2sdk1.6 for jboss runtime<o:p></o:p></span></font></p>

<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>with
regards<br>
Karthik<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>