Mark Lybarger wrote:
i'm trying to figure out how to setup a data source within openejb. the examples i have seen thus far use a resource-ref to get to the datasource. the application i'm using doesn't use a resource-ref. it has a data source defined in weblogic, and the beans do a lookup to get a reference to that jndi name.
When you defined the data source in weblogic you'll need to use WLInitialContextFactory of WebLogic instead of OpenEJB. It's not visible to OpenEJB at all.
i had read some perhaps old emailings that openejb only supported the jca, and didn't want to get into the business of connection pooling, etc. then again, maybe i misread.
These old emailings related to OpenEJB 2 that doesn't have all the features of OpenEJB 1 and vice versa. I'm not sure if OpenEJB2 can be embedded into Tomcat (I'm almost certain it cannot at the moment).
is it possible for me to configure openejb to make available a datasource outside of using a resource-ref?
You don't have to use resource-ref. You can declare InitialContextFactory as the Local or Remote one of OpenEJB and use the stuff bound to it. Resource-refs are the way to abstract a code from the real container of these refs. Using resource-ref allows you to make changes to resource configuration outside of your code (no recompilation necessary then).
Just attach itself to OpenEJB JNDI via the Local or Remote InitialContext (see http://www.openejb.org/embedded.html or http://www.openejb.org/remote-server.html) and lookup what's available casting where required to the appropriate type, e.g. javax.sql.DataSource.
i took a look at the test suite for the geronimo integration, and there's some stuff in the rar that loads axion that seems to handle a "regular" datasource, but i'm not sure how to use it with an embeded openejb server. can i just add some of the stuff from the .rar to my openejb.conf?
Well, I doubt if it's possible. You might have worked with OpenEJB2 where some things change heavily. I'd stick with OpenEJB1 and define Axion datasource as explained in http://www.openejb.org/cmp_entity_postgresql.html about PostgreSQL.
~mark
Best, Jacek
