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@orion        Subject:     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







Reply via email to