I have started working with Jboss and was trying to access 2 different mysql
databases on the same server. When I do this the server comes up with the
following warning:
13:44:38,984 WARN [LocalTxConnectionManager$LocalConnectionEventListener]
prepare called on a local tx. You are not getting the semantics you expect!
13:44:38,985 WARN [LocalTxConnectionManager$LocalConnectionEventListener]
prepare called on a local tx. You are not getting the semantics you expect!
If only access one of the databases (either one), no warnings and response
is quick. If I hit both I get the warning and much slower response. I
suppose because it has to process the Event. In all cases, it does retrieve
the correct information from the databases.
Any ideas about this warning???
We are running jboss-3.0.0_tomcat-4.0.3 on a Solaris system using jdk 1.3.
Here is the code:
package cae.mysql;
import java.util.*;
import javax.ejb.SessionBean;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.sql.*;
public class MySQLBean implements SessionBean {
public void ejbCreate() {}
public void ejbPostCreate() {}
public String getTL (String tlname) throws java.rmi.RemoteException {
return getchk();
}
public String getchk() {
PreparedStatement pstmt = null;
Connection conn = null;
try {
conn = getConnectionchk();
pstmt = conn.prepareStatement("Select fval from checkit where
find = 1");
ResultSet rs = pstmt.executeQuery();
if (rs.next()) {
return rs.getString("fval");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}
return "Shucks";
}
public String getTL() {
PreparedStatement pstmt = null;
Connection conn = null;
try {
conn = getConnectionTL();
pstmt = conn.prepareStatement("Select des_num from contains
where draw_num = 174183");
ResultSet rs = pstmt.executeQuery();
if (rs.next()) {
return rs.getString("des_num");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}
return "Dang, Missed again<br>\n";
}
public Connection getConnectionchk() throws Exception {
try {
Context ctx = new InitialContext();
javax.sql.DataSource ds =
(javax.sql.DataSource)ctx.lookup("java:comp/env/jdbc/chkDS");
return ds.getConnection();
} catch (Exception e) {
System.err.println("Couldn't get datasource!");
e.printStackTrace();
throw e;
}
}
public Connection getConnectionTL() throws Exception {
try {
Context ctx = new InitialContext();
javax.sql.DataSource ds =
(javax.sql.DataSource)ctx.lookup("java:comp/env/jdbc/TravLogDS");
return ds.getConnection();
} catch (Exception e) {
System.err.println("Couldn't get datasource!");
e.printStackTrace();
throw e;
}
}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void setSessionContext(javax.ejb.SessionContext ec) {}
}
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user