<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>
* Singleton process<br>
*/<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>
if (instance == null) {<br>
synchronized
(DBConnectionManager.class) {<br>
if
(instance == null) {instance = new DBConnectionManager(); }<br>
}<br>
}<br>
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>
*/<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>
Connection connx = null;<br>
Connection underlyingConn = null;<br>
try {<br>
connx = ODS.getConnection();<br>
WCP = (WrappedConnection)connx;<br>
underlyingConn = WCP.getUnderlyingConnection();<br>
connx = (OracleConnection)underlyingConn;<br>
} catch (SQLException sqlex) {<br>
sqlex.printStackTrace();<br>
} <br>
return connx;<br>
}<o:p></o:p></span></font></p>
<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'><o:p> </o:p></span></font></p>
<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>/**<br>
* Free connection<br>
*/<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>
System.ou.println("RELEASING THE USED CONNECTION TO POOL");<br>
try {<br>
//@IMP JBOSS does not require this connection to close<br>
//con.close();<br>
//Close WRAPPER Connection<br>
WCP.close();<br>
}catch (Exception e) {<br>
System.out.println("CAN'T CLOSE CONNECTION FOR POOL
");<br>
e.printStackTrace();<br>
} <br>
}<o:p></o:p></span></font></p>
<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'><o:p> </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>
<local-tx-datasource><br>
<jndi-name>jdbc/ORACLESCHEMA1</jndi-name><br>
<connection-url>jdbc:oracle:thin:@172.16.17.70:1521:SCHEMA1</connection-url><br>
<driver-class>oracle.jdbc.OracleDriver</driver-class><br>
<user-name>SCHEMAUSERID</user-name><br>
<password>SCHEMAPASSWD</password><br>
<min-pool-size>10</min-pool-size><br>
<max-pool-size>60</max-pool-size><br>
<track-statements>false</track-statements><br>
<metadata><br>
<type-mapping>Oracle9i</type-mapping><br>
</metadata><br>
</local-tx-datasource><o:p></o:p></span></font></p>
<p><font size=1 face="Times New Roman"><span style='font-size:9.0pt'>>From jmx-console
“name=jdbc/ORACLESCHEMA1,service=ManagedConnectionPool” <br>
We observe that with in 10 minuts “</span></font><font
size=2><span style='font-size:10.0pt'>AvailableConnectionCount</span></font>”
<font size=2><span style='font-size:10.0pt'>was become ‘0’<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> </o:p></span></font></p>
</div>
</body>
</html>