DBPOOL / JNDI standalone ?

"Patrice Bonhomme" <[email protected]> Thu, 20 Jul 2006 14:07:32 +0200
Newsgroups gmane.text.xml.resin.user
Organization 1001 listes
Message-ID <[email protected]>
Hi,

I am trying to use a standalone JNDI DbPool for test purposes. Here is the
method that makes the JNDI binding for my pool connexions :

public static void initialize() {	    
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"com.caucho.naming.InitialContextFactoryImpl");
    System.setProperty(Context.URL_PKG_PREFIXES, "com.caucho.naming");
	    
    try {
    	
      DBPool dbPool = new DBPool();
      dbPool.setJndiName("jdbc/sybase");
      dbPool.setJDBCDriver(new com.sybase.jdbc2.jdbc.SybDriver());
      dbPool.setURL("jdbc:sybase:Tds:100.100.100:5000/dbXxxxxx");
      dbPool.setUser("xxxxxxxxx");
      dbPool.setPassword("xxxxxxx");
      dbPool.setTransactionManager(TransactionManagerImpl.getInstance());
      dbPool.setMaxConnections(20);
      dbPool.setPreparedStatementCacheSize(8);
      dbPool.setMaxIdleTime(new com.caucho.config.types.Period(20000));

      dbPool.init();	      

    } catch (Exception e) {
      throw new RuntimeException(e);
    }
}


And i got this error :

java.lang.RuntimeException: com.caucho.config.ConfigException: the
connection manager needs a transaction manager.
	at
fr.lunasquare.tests.DataSourceJndi.initialize(DataSourceJndi.java:46)
	at fr.lunasquare.tests.FSHelperTest.main(FSHelperTest.java:29)
Caused by: com.caucho.config.ConfigException: the connection manager needs a
transaction manager.
	at com.caucho.jca.ConnectionPool.init(ConnectionPool.java:445)
	at com.caucho.sql.DBPool.init(DBPool.java:580)
	at
fr.lunasquare.tests.DataSourceJndi.initialize(DataSourceJndi.java:44)
	... 1 more
Exception in thread "main" 

Any suggestions ?

Tx,
Pat