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.