Re: Oracle database and connection pooling

2001-02-01 Thread jbirchfield


Try this:

DataSource dataSource = (DataSource)context.lookup("jdbc/OraclePooledDS");
Connection con = dataSource.getConnection();

orion will return a pooled connection to you.

James Birchfield

Ironmax
a better way to buy, sell and rent construction equipment
5 Corporate Center
9960 Corporate Campus Drive,
Suite 2000
Louisville, KY 40223


   

Danut Prisacaru

[EMAIL PROTECTED]   To: Orion-Interest 
[EMAIL PROTECTED]  
Sent by:  cc:  

owner-orion-interest@orionSubject: Oracle database and 
connection pooling  
server.com 

   

   

02/01/01 02:44 PM  

Please respond to  

Orion-Interest 

   

   





Hi,

I am new to EJBs so I apologize if my question sounds silly. I am trying to

configure Orion to use Oracle 8 and pooled connections.

This is how my data-source looks like:

data-source
   class="com.evermind.sql.ConnectionDataSource"
   ejb-location="jdbc/MyApollo"
   location="jdbc/OracleCoreDS"
  pooled-location="jdbc/OraclePooledDS"
   name="Oracle"
   schema="database-schemas/oracle.xml"
   xa-location="jdbc/xa/OracleXADS"
   connection-driver="oracle.jdbc.driver.OracleDriver"
   username="system"
   password="manager"
   url="jdbc:oracle:oci8:@APOLLO"
   inactivity-timeout="30"
/

I am trying to implement a BMP and here is the code I am using to get the
connection:

public void setEntityContext(EntityContext ec)
{
 ...
 Context initialContext = new InitialContext();
 ConnectionPoolDataSource dataSource = (ConnectionPoolDataSource)
initialContext.lookup( "jdbc/OraclePooledDS" );
}

and later on

public Connection getConnection() throws SQLException
{
 ...
 return dataSource.getPooledConnection().getConnection();
}

I get the folowing exception in my client code when I create the bean

javax.ejb.EJBException: com.evermind.sql.OrionPooledDataSource
 at com.evermind.server.rmi.ba.invokeMethod(JAX)
 at com.evermind.server.rmi.a1.invoke(JAX)
 at com.evermind.server.rmi.a2.invoke(JAX)
 at __Proxy2.create(Unknown Source)
 at SelectTestClient.main(SelectTestClient.java:117)

that seems to be thrown
when the execution reaches the following line of code:
 ConnectionPoolDataSource dataSource = (ConnectionPoolDataSource)
initialContext.lookup( "jdbc/OraclePooledDS" );

Thanks!
Danut


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com










RE: Oracle database and connection pooling

2001-02-01 Thread Madrid, Christopher P (US - Austin)
Title: RE: Oracle database and connection pooling





Try using com.evermind.sql.DriverManagerDataSource as your datasource class and set your max-connections. Look it up using your ejb-location and setting it to the standard DataSource interface. Orion will pool the connection automatically. Since you are using BMP, remember to close your connection.

Chris Madrid
Deloitte Consulting



-Original Message-
From:  Danut Prisacaru [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 01, 2001 1:44 PM
To: Orion-Interest
Subject: Oracle database and connection pooling


Hi,


I am new to EJBs so I apologize if my question sounds silly. I am trying to 
configure Orion to use Oracle 8 and pooled connections.


This is how my data-source looks like:


 data-source
 class=com.evermind.sql.ConnectionDataSource
 ejb-location=jdbc/MyApollo
 location=jdbc/OracleCoreDS
 pooled-location=jdbc/OraclePooledDS
 name=Oracle
 schema=database-schemas/oracle.xml
 xa-location=jdbc/xa/OracleXADS
 connection-driver=oracle.jdbc.driver.OracleDriver
 username=system
 password=manager
 url=jdbc:oracle:oci8:@APOLLO
 inactivity-timeout=30
 /


I am trying to implement a BMP and here is the code I am using to get the 
connection:


public void setEntityContext(EntityContext ec)
{
 ...
 Context initialContext = new InitialContext();
 ConnectionPoolDataSource dataSource = (ConnectionPoolDataSource) 
initialContext.lookup( jdbc/OraclePooledDS );
}


and later on


public Connection getConnection() throws SQLException
{
 ...
 return dataSource.getPooledConnection().getConnection();
}


I get the folowing exception in my client code when I create the bean


javax.ejb.EJBException: com.evermind.sql.OrionPooledDataSource
 at com.evermind.server.rmi.ba.invokeMethod(JAX)
 at com.evermind.server.rmi.a1.invoke(JAX)
 at com.evermind.server.rmi.a2.invoke(JAX)
 at __Proxy2.create(Unknown Source)
 at SelectTestClient.main(SelectTestClient.java:117)


that seems to be thrown
when the execution reaches the following line of code:
 ConnectionPoolDataSource dataSource = (ConnectionPoolDataSource) 
initialContext.lookup( jdbc/OraclePooledDS );


Thanks!
Danut



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.