protected Connection getConnection()
String mensajeLog =
"Cogiendo conexion en " + this.getClass ().getName ();
if (log.isDebugEnabled ()) log.debug (mensajeLog);
InitialContext context = new InitialContext ();
DataSource source = (DataSource)context.lookup ("java:/MK");
return source.getConnection ();
throw new javax.ejb.EJBException(mensajeLog,ne);
}catch (java.sql.SQLException sqle)
throw new javax.ejb.EJBException(mensajeLog,sqle);
where MK is my connection pool.
If you don't like edit the deploy jars, use xdoclet and left it generates this files for you.
Thanks. It works.
2. Use the XDataSourceLoader (in 2.4.x). Otherwise there is no way for the transaction manager to control the transactions for you. Most dbs don't have working xa drivers, so there is the XADataSourceImpl which makes non xa look like xa (but without actually doing 2pc).
If you are using db + transacted jms, you want real xa, such as Firebird and expensive db's have.
3. I only work on 3.0 and still think the $$2.4 docs are worth it. You might find it at your bookstore, too, and take a look.
4. I recommend xdoclet also.