[jboss-user] Loosing DB Connectionson doing load test ...:(

Stephen Davidson gorky at freenet.carleton.ca
Sun Aug 16 18:22:20 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Karthik.

Q: Why do do you need to access the underlying connection directly?
Usually, this is not a good idea, unless you are writing your own
connection wrapper.

In regards to this mailing, you would be better off posting on the
forums, as it does not appear that this list is monitored any more by
the JBoss Group.

Regards,
Steve

Karthik Nanjangude wrote:
> Hi
> 
> The url below says how to extract a Oracle type Connection from JBOSS
> Wrapper
> http://forums.oracle.com/forums/thread.jspa?messageID=1384788
> No problem is getting the connection, but Do Not know how to close the
> same for the obtained connection to be returned
> The code is as given below
> 
> private WrappedConnection WCP = null;
> 
> /**
>  * Singleton process
>  */
> 
> public static DBConnectionManager getInstance() throws InfinetException {
>    if (instance == null) {
>                 synchronized (DBConnectionManager.class) {
>                    if (instance == null) {instance = new
> DBConnectionManager(); }
>       }
>     }
>     return instance;
> }
> 
> /**
> * Get connection
>  */
> 
> public Connection getConnection()throws InfinetException{
>   Connection connx = null;
>   Connection underlyingConn = null;
>       try {
>                   connx = ODS.getConnection();
>                   WCP = (WrappedConnection)connx;
>                   underlyingConn = WCP.getUnderlyingConnection();
>                   connx =  (OracleConnection)underlyingConn;
>        } catch (SQLException sqlex) {
>                 sqlex.printStackTrace();
>        }                      
>   return connx;
>   }
> 
>  
> 
> /**
>  * Free connection
>  */
> 
> public void freeConnection(Connection con) throws InfinetException {
>   System.ou.println("RELEASING THE USED CONNECTION TO POOL");
>   try {
>      //@IMP JBOSS does not require this connection to close
>      //con.close();
>      //Close WRAPPER Connection
>      WCP.close();
>   }catch (Exception e) {
>     System.out.println("CAN'T CLOSE CONNECTION FOR POOL ");
>     e.printStackTrace();
>   }           
> }
> 
>  
> 
> Oracle-ds.xml is as follows
> <local-tx-datasource>
> <jndi-name>jdbc/ORACLESCHEMA1</jndi-name>
> <connection-url>jdbc:oracle:thin:@172.16.17.70:1521:SCHEMA1</connection-url>
> <driver-class>oracle.jdbc.OracleDriver</driver-class>
> <user-name>SCHEMAUSERID</user-name>
> <password>SCHEMAPASSWD</password>
> <min-pool-size>10</min-pool-size>
> <max-pool-size>60</max-pool-size>
> <track-statements>false</track-statements>
> <metadata>
> <type-mapping>Oracle9i</type-mapping>
> </metadata>
> </local-tx-datasource>
> 
>>From jmx-console
>  “name=jdbc/ORACLESCHEMA1,service=ManagedConnectionPool”
> We observe that   with in 10 minuts “AvailableConnectionCount” was 
> become ‘0’
> 
> Any help would be appreciated
> 
> SPEC
> JBOSS 4.2.1
> ORACLE DB : 10G DB
> jar : ojdbc14.jar
> j2sdk 1.4 for development
> j2sdk1.6 for jboss runtime
> 
> with regards
> Karthik
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> jboss-user mailing list
> jboss-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-user

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkqIhpwACgkQSphIUSiVzgZtOwCgs21ybdw6ZHcr99j22nIEtjIs
Wc8AoOAlw3OdMiHGk3f3qZE4GuYCMCGz
=o+Kh
-----END PGP SIGNATURE-----



More information about the jboss-user mailing list