Ok, it took a while, but I can confirm that your test produces the error on
JBoss 3.2 from CVS with clustering turned off.  Two things you might be
missing are 1) increasing the thread count in the client to 100 makes it
more likely to happen more quickly and 2) the test client does not receive
the error.  The error ONLY shows up in the server log file (and stdout).

We are using Oracle 9.2.0.1.0.  The JDBC driver version is 9.2.0.0.0 as
reported in the manifest.

Just to make sure I'm not missing something here are all the boring details
of what I did.

1. Got the latest from CVS
2. ./build.sh clobber
3. built JBoss with integrated Tomcat 4.1.18
4. Tweaked TestBean as follows to make it work in my build environment.
None of these changes should matter to the test.
      - changed bean name from test/Test to Test
      - changed the view-type to remote because our build doesn't do
<localinterface> for xdoclet
      - changed the data source name.  Yours was XAOracleDS and mine is
XaOracleDS
      - changed the name of your remote interface to TestRemoteIF to match
our naming conventions
5. made corresponding changes to TestMtClient and increased the number of
threads to 100
6. built into an EAR
7. added my oracle-xa-ds.xml to the default configuration
8. turned on Pad in the XidFactory for the transaction manager in the
default configuration
9. deployed my EAR to the default configuration
10. started the default configuration
11. ran TestMtClient long enough to get the error.  The error shows up in
the server log file and stdout.

Thanks,
Matt Cleveland

> I just ran 50 threads calling into an EJB that inserts a record into a
> database. This test ran for about half an hour and created about 52000
> records without any exception whatsoever. I am using JBoss 3.2 from cvs
> (no cluster, though), win2k sp2, jdk 1.4.1_01, classes12.zip from 9201
> distribution; oracle 9.2.0.1 under solaris 8.
>
> Attached is my test SSB and its client. If this test ejb fails in your
> environment (make sure you do  not run cluster) then... well, there is
> not much I can do. If this test works, try to make it fail with
> XAER_RMERR by changing JBoss configuration and SSB.
>
> --
> Igor Fedorenko
> Think smart. Think automated. Think Dynamics.
> www.thinkdynamics.com
>


----------------------------------------------------------------------------
----


> package simple.ejb;
>
> import java.rmi.RemoteException;
> import java.sql.Connection;
> import java.sql.SQLException;
> import java.sql.Statement;
>
> import javax.ejb.EJBException;
> import javax.ejb.SessionBean;
> import javax.ejb.SessionContext;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import javax.naming.NamingException;
> import javax.sql.DataSource;
>
> /**
>  * @author ifedorenko
>  *
>  * @ejb:bean type="Stateless" name="test/Test"
>  *      jndi-name="ejb/test/Test"
>  * @ejb:transaction type="Required"
>  *
>  * @ejb:resource-ref res-name="jdbc/OracleDS"
res-type="javax.sql.DataSource"
>  *         res-auth="Container"
>  *
>  * @jboss:resource-ref res-ref-name="jdbc/OracleDS"
jndi-name="java:/XAOracleDS"
>  */
> public class TestBean implements SessionBean {
>
>     /**
>      * 1. Gets JDBC connection
>      * 2. Updates DB
>      *
>      * @ejb:interface-method
>      */
>     public String getTest() {
>         Connection conn = null;
>         try {
>             // get jdbc connection
>             conn = makeConnection();
> //            conn.setAutoCommit(false);
> //            conn.rollback();
> //
conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
>             // jdbc update
>             Statement stmt = conn.createStatement();
>             try {
>                 stmt.executeUpdate("insert into test(f1) values
(to_char(sysdate, 'dd:mm:yyyy'))");
>             } finally {
>                 stmt.close();
>             }
>             return "Something else";
>         } catch (SQLException e) {
>             throw new EJBException(e);
>         } finally {
>             try {
>                 if (conn != null) {
>                     conn.close();
>                 }
>             } catch (SQLException e) {
>                 throw new EJBException(e);
>             }
>         }
>     }
>
>     protected Connection makeConnection() {
>         Context ctx = null;
>         DataSource ds = null;
>         try {
>             ctx = new InitialContext();
>             ds = (DataSource) ctx.lookup("java:comp/env/jdbc/OracleDS");
>             Connection conn = ds.getConnection();
>             return conn;
>         } catch (NamingException e) {
>             throw new EJBException(e);
>         } catch (SQLException e) {
>             throw new EJBException(e);
>         } finally {
>             try {
>                 if (ctx != null) {
>                     ctx.close();
>                 }
>             } catch (NamingException e) {
>                 throw new EJBException(e);
>             }
>         }
>     }
>
>     /* (non-Javadoc)
>      * @see javax.ejb.SessionBean#ejbActivate()
>      */
>     public void ejbActivate() throws EJBException, RemoteException {
>     }
>
>
>     /* (non-Javadoc)
>      * @see javax.ejb.SessionBean#ejbPassivate()
>      */
>     public void ejbPassivate() throws EJBException, RemoteException {
>     }
>
>
>     /* (non-Javadoc)
>      * @see javax.ejb.SessionBean#ejbRemove()
>      */
>     public void ejbRemove() throws EJBException, RemoteException {
>     }
>
>
>     /* (non-Javadoc)
>      * @see javax.ejb.SessionBean#setSessionContext(SessionContext)
>      */
>     public void setSessionContext(SessionContext arg0)
>         throws EJBException, RemoteException {
>     }
>
>     public void ejbCreate() {
>     }
>
> }
>
>


----------------------------------------------------------------------------
----


> package simple.ejb.client;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import javax.rmi.PortableRemoteObject;
>
> import simple.ejb.Test;
> import simple.ejb.TestHome;
>
> /**
>  * @author ifedorenko
>  */
> public class TestMtClient implements Runnable {
>
>     public void run() {
>         try {
>             for (int i = 0; ; i++) {
>                 if ((i % 10) == 0) {
>                     System.out.println(Thread.currentThread().getName() +
": " + i);
>                 }
>                 Context ctx = new InitialContext();
>                 Object objRef = ctx.lookup("ejb/test/Test");
>                 TestHome home = (TestHome)
>                         PortableRemoteObject.narrow(objRef,
TestHome.class);
>                 Test bean = home.create();
>                 try {
>                     bean.getTest();
>                 } finally {
>                     bean.remove();
>                 }
>             }
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>     }
>
>     public static void main(String[] args) throws Exception {
>         int max = 50;
>         for (int i = 0; i < max; i++) {
>             new Thread(new TestMtClient()).start();
>         }
>     }
> }
>




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to