Thanks!  Does this return a pooled connection?

I have a two column table with a String primary key and a long 
(next).  Simplied, this test program  invokes a stateless session bean that 
uses an entity bean that invokes findByPrimaryKey (always the same key) and 
then:
long temp = bean.getNext();
temp++;
bean.setNext(temp);
and returns temp.  Pretty straightforward...

Using HypersonicSQL and CMP this takes under 2ms a pass.  My initial BMP 
version ran at about 3ms a pass, and then, for no apparent reason and no 
changes, started taking over 100ms/pass - and occasionally returning back 
to 3ms.  We suspect a hypersonic weirdity, or a bug in the entity bean, but 
haven't figured it out yet.  Has anyone else seen anything similar?  I'm 
using Win98/Sun 1.2.2/Orion 1.0.3, and the latest version of Hypersonic, 
and the only changes were in the entity bean and XML files.

BTW, I've used Hypersonic on the same machine and PostgreSQL and Sybase to 
a LAN connected Linux system for performance tests.  During the CMP testing 
switching between them was trivial - uncomment different sections in 
data-sources.xml, make sure that the appropriate DBMS is running, and 
restart orion.  Very impressive.  It also looks like CMP caching works very 
well; cachable tests had very similar times regardless of the DBMS.

Kirk Yarina

At 10:08 PM 6/14/00 +0200, you wrote:
>Hello Kirk,
>
>You should use the datasource specified by the EJB-location. In your case that
>is jdbc/DefaultEJBDS.
>
>Regards,
>Karl Avedal
>
>KirkYarina wrote:
>
> > I'm running a series of performance tests as both a learning tool and to
> > assist our chief designer, and am converting our test suite from CMP to 
> BMP.
> >
> > I'm confused about how Orion manages jdbc connection pooling.  The  mail
> > archive discussion I found , from last November, is adding to the fog....
> >
> > The following snippet from data-sources.xml would suggest that it's
> > possible to obtain either a pooled or non-pooled connection by using either
> > jdbc/DefaultDS or jdbc/DefaultPooledDS - but I'm getting similar benchmark
> > times using either one (by changing which line is commented in
> > getConnection, below).
> >
> > Could someone tell me what is being returned by either of these, if I'm
> > headed in the right direction, and where to look if I'm not?
> >
> > Thanks!
> >
> > Kirk Yarina
> >
> >          <data-source
> >                  name="Default data-source"
> >                  class="com.evermind.sql.ConnectionDataSource"
> >                  location="jdbc/DefaultDS"
> >                  pooled-location="jdbc/DefaultPooledDS"
> >                  xa-location="jdbc/xa/DefaultXADS"
> >                  ejb-location="jdbc/DefaultEJBDS"
> >                  url="jdbc:HypersonicSQL:defaultdb"
> >                  connection-driver="org.hsql.jdbcDriver"
> >                  username="sa"
> >                  password=""
> >                  schema="database-schemas/hypersonic.xml"
> >          />
> >
> >    private Connection
> >    getConnection()
> >      {
> > //    String dsName = "jdbc/DefaultPooledDS";  // Pooled connections?
> >      String dsName = "jdbc/DefaultDS";  // non-pooled connections?
> >
> >      InitialContext initialContext = null;
> >
> >      try {
> >        initialContext = new InitialContext();
> >        }
> >      catch ( Exception ex )
> >        {
> >        System.err.println( "-- Getting Initial Context --" );
> >        ex.printStackTrace( System.err );
> >        throw new EJBException
> >          ( "getting Sequence InitialContext, " + ex.getMessage() );
> >        }
> >
> >      try {
> >        DataSource ds =
> >          (DataSource) initialContext.lookup( dsName );
> >
> >        return ds.getConnection();
> >        }
> >      catch ( Exception ex )
> >        {
> >        System.err.println
> >          ( "-- looking up DataSource '" + dsName + "' --" );
> >        ex.printStackTrace( System.err );
> >        throw new EJBException
> >          ( "looking up dsName '"
> >            + dsName + "', " + ex.getMessage() );
> >        }
> >      }
> >
> > Kirk Yarina
> > [EMAIL PROTECTED]


Kirk Yarina
[EMAIL PROTECTED]


Reply via email to