Hi,

We are currently using Interbase in a pre-production environment.
(an e-commerce mall) So far it performs acceptable, but because
we are only in a test phase now there is a chance we will have to
switch to Oracle... i'll let you know if you like?!

Regarding Interbase as a java:comp/env/jdbc datasource I have
have done the following in my configuration files:
(btw. this i jBoss 2.1 (probably a month old)

Interbase is configured in jboss.jcml as follows:

  <!-- JDBC -->
  <mbean code="org.jboss.jdbc.JdbcProvider"
name="DefaultDomain:service=JdbcProvider">
     <attribute name="Drivers">interbase.interclient.Driver</attribute>
  </mbean>

  <mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=InterBaseDB">
    <attribute name="PoolName">InterBaseDB</attribute>
    <attribute
name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImp
l</attribute>
    <attribute name="Properties"></attribute>
    <attribute
name="URL">jdbc:interbase://localhost/k:\xxx\yyy\zzz.gdb</attribute>
    <attribute name="GCMinIdleTime">1200000</attribute>
    <attribute name="MaxSize">10</attribute>
  </mbean>

In jboss.xml I have defined a resourcemanager:

<jboss>
 <secure>false</secure>
 <container-configurations />
 <resource-managers>
  <resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
   <res-name>CityShopDataSourceManager</res-name>
   <res-jndi-name>InterBaseDB</res-jndi-name>
  </resource-manager>
  <resource-manager>
   <res-name>mail/CityshopMail</res-name>
   <res-jndi-name>CityshopMailerDeamon</res-jndi-name>
  </resource-manager>
 </resource-managers>
 <enterprise-beans>
  <entity>
   ...

For each bean using the datasource in jboss.xml:

 <entity>
  <ejb-name>OrderEJB</ejb-name>
  <jndi-name>order/Order</jndi-name>
  <resource-ref>
   <res-ref-name>jdbc/DBPool</res-ref-name>
   <resource-name>CityShopDataSourceManager</resource-name>
  </resource-ref>
 </entity>
 ...

In standardjaws.xml I specify InterBaseDB (the name used in jboss.xml in
the resourcemanager section ) as a datasource:

<jaws>
 <datasource>java:/InterBaseDB</datasource>
 <type-mapping>InterBase</type-mapping>
 <default-entity>
  <create-table>false</create-table>
  <remove-table>false</remove-table>
  ...

In ejb-jar.xml, again for each bean using it:

<entity>
 <ejb-name>OrderEJB</ejb-name>
 <home>com.netmill.cityshop.interfaces.order.OrderEJBHome</home>
 <remote>com.netmill.cityshop.interfaces.order.OrderEJB</remote>
 <ejb-class>com.netmill.cityshop.ejb.order.OrderEJBBean</ejb-class>
 <persistence-type>Container</persistence-type>
 <prim-key-class>java.lang.Integer</prim-key-class>
 <reentrant>False</reentrant>
 <cmp-field><field-name>orderId</field-name></cmp-field>
 <cmp-field><field-name>itemId</field-name></cmp-field>
 <cmp-field><field-name>numberOfItems</field-name></cmp-field>
 <cmp-field><field-name>storeId</field-name></cmp-field>
 <cmp-field><field-name>forceStore</field-name></cmp-field>
 <primkey-field>orderId</primkey-field>
 <resource-ref>
  <res-ref-name>jdbc/DBPool</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
 </resource-ref>
</entity>
...

And finally, the code using the datasource could be something like:


    /*
     * initDBConnection create a database connection
     */
    private int initDBConnection(){

        int retVal = -1 ;

        // Get the jndi context
        if (getNamingContext() != 1){
            retVal = -1 ;
        }
        // Lookup datasource
        try {
            _ds =
(DataSource)_jndiContext.lookup("java:comp/env/jdbc/DBPool");
        } catch(javax.naming.NamingException ne) {
            cat.error("NamingException:
_jndiContext.lookup(\"java:comp/env/jdbc/DBPool\") failed: " +
ne.getMessage());
            retVal = -1 ;
        }
        // Get connection
        try{
            _conn = _ds.getConnection();
            cat.debug("Got 'java:comp/env/jdbc/DBPool' handle");
        } catch(java.sql.SQLException se){
            cat.error ("SQLException: _ds.getConnection() failed: " +
se.getMessage());
            retVal = -1 ;
        }
        // Create statement
        try{
            _stmt = _conn.createStatement();
            cat.debug("Did _conn.createStatement()");
            retVal = 1;
        } catch(java.sql.SQLException se){
            cat.error ("SQLException: _ds.getConnection() failed: " +
se.getMessage());
            retVal = -1 ;
        }

                ...

That way we get: java:comp/env/jdbc/DBPool -> CityShopDataSourceManager ->
InterBaseDB


Hope this helps....

^torsten



> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Michael
> Quigley
> Sent: 27. marts 2001 04:52
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] Database Issues -- InterBase
>
>
> > I'm using postgresql quite successfully.
>
> That's good to know. I was actually checking out version 7.0.3
> this evening.
>
> > > Yesterday, I was experiencing a strange issue where if I had an isql
> shell
> > > open in one window, my CMP transactions would hang in JBoss.
> If I ran a
> > > "commit;" in my isql window, JBoss would come back to life. This was
> after
> > > simply doing a SELECT in the isql window--no changes were made to data
> at
> > > all.
> >
> > Depending on what the database thinks its isolation levels
> > should be, that might not be so unusual.
>
> Well, combined with the database corruption I experienced, it made me
> uncomfortable. I do a lot of EJB development using WebLogic with Oracle8i
> and I've not witnessed that kind of behavior in that environment.
>
> > It will always get bound at java:/InterbaseDS, the trick is in putting
> > the right magic in jboss.xml to get it mapped over where you want it.
> >
> > Someone posted a recipe earlier today. Have you seen this?
>
> Unfortunately I've not seen it.
>
> Okay, that makes sense about the binding. I'll look in the archive and see
> if it's there.
>
> Thanks,
> Michael
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to