Hi,
I am using Oracle's oci8 driver and managed to set up a connection pool
in JBOSS. The server
and pool seemed to have started correctly. But when I tried to access
the pool with the
following code sequence within an ejb, I get a naming exception saying
"MyConnectionPool
not bound". When setting up the MLET declarations, does the "name"
parameter automatically
become the JNDI name ? May be I'm doing something else wrong ?
Pls advise. Thanks.
Code to getConnection in EJB:
InitialContext initCtx = null;
try {
initCtx = new InitialContext();
DataSource ds = (javax.sql.DataSource)
initCtx.lookup("MyConnectionPool");
return ds.getConnection();
} catch(NamingException ne) {
ne.printStackTrace();
}
In jboss.conf, I have
<MLET CODE="org.jboss.jdbc.XADataSourceLoader"
ARCHIVE="jboss.jar,classes12.zip"
CODEBASE="../lib/ext/">
<ARG TYPE="java.lang.String" VALUE="MyConnectionPool">
<ARG TYPE="java.lang.String"
VALUE="org.jboss.minerva.xa.XADataSourceImpl">
</MLET>
and in jboss.jcml, I have (some attributes were inserted by the server):
<mbean
name="DefaultDomain:service=XADataSource,name=MyConnectionPool">
<attribute name="Properties"></attribute>
<attribute name="URL">jdbc:oracle:oci8:@dbservice</attribute>
<attribute name="GCMinIdleTime">1200000</attribute>
<attribute name="JDBCUser">userName</attribute>
<attribute name="MaxSize">0</attribute>
<attribute name="Password">userPasswd</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">true</attribute>
<attribute name="GCInterval">120000</attribute>
<attribute name="IdleTimeout">1800000</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="MaxIdleTimeoutPercent">1.0</attribute>
<attribute name="MinSize">0</attribute>
</mbean>
Ben Wong
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]