1 Reply Latest reply on May 13, 2003 8:39 PM by davidjencks

    Toplink 4.0, JBoss 3.2.1 and Oracle 8i

    jdeviney

      Does anyone have experience integrating Toplink 4.x for Java (no entity beans) and Jboss?

      I have an MBean which is supposed to load a Toplink project and instantiate a ServerSession to service session EJB's in the container. For this to work properly Toplink needs to tie into the app server's transaction manager/connection pool.

      In the past I have worked with Weblogic 6.x and successfully integrated Toplink in this fashion. Now I'm trying to do the same with JBoss.

      Code sample from the weblogic integration follows:

      MBean or startup class to load the Toplink project and instantiate a ServerSession ...

      public class ToplinkServer extends ServiceMBeanSupport implements ToplinkServerMBean {

      protected void startService() throws Exception {

      String driveLetter = SystemProperties.getSystemProperty("driveLetter");
      String nexgenPath = SystemProperties.getSystemProperty("nexgenPath");
      DatabaseLogin.setXMLParserJARFileNames(new String[] { driveLetter + nexgenPath + "lib/toplink/xerces.jar", driveLetter + nexgenPath + "/lib/toplink/wdisdkxerces.jar" });
      System.out.println(driveLetter + nexgenPath + "lib/toplink/wdisdkxerces.jar");
      project = XMLProjectReader.read(driveLetter + nexgenPath + "toplink/mapping/nexgen.xml");
      DatabaseLogin login = (DatabaseLogin)project.getLogin();
      login.useDirectDriverConnect("weblogic.jdbc.jts.Driver", "jdbc:weblogic:jts:" + poolName, "");
      login.getProperties().remove("user");
      login.getProperties().remove("password");
      login.useExternalConnectionPooling();
      login.useExternalTransactionController();
      DatabaseLogin readLogin = (DatabaseLogin)login.clone();
      readLogin.setDriverClassName("weblogic.jdbc.pool.Driver");
      readLogin.setConnectionString("jdbc:weblogic:pool:" + poolName);
      server = new ServerSession(project, 0, 0, readLogin);

      ...
      }
      ...
      }

      I've tried many things for useDirectDriverConnect(), setDriverClassName() and setConnectionString() without success.

      I'm about to give up on Toplink and move on to another solution for persistence.

      Thnx.

        • 1. Re: Toplink 4.0, JBoss 3.2.1 and Oracle 8i
          davidjencks

          Not knowing anything about toplink, I may not be giving useful comments.

          In jboss, if you deploy a datasource using the jca-jdbc wrappers, transactions in the adapter will be controlled by the jta transaction manager. However, most O/R or cache tools need to know about the tm so they can use Synchronizations to flush dirty data to the db before commit.

          I see 2 things that look like datasource configuration in your sample, but nothing that looks like it shows toplink where the tm is. I would imagine that the toplink docs would indicate something about how to specify where the tm is. In JBoss, you'd look up both a datasource and the tm in jndi.

          The datasource will be something like java:/myDS. The transaction manager is bound to java:/TransactionManager. Use the jndiview mbean to see the exact names.