3 Replies Latest reply on Jun 3, 2008 9:22 AM by jhalliday

    Problem with XA recover ?

    fancoli

      Hi,
      we have two JBoss 4.2.2 clustered server; we use XADatasource with ISeries V5R4 with the recovery manager enabled we also use the new transaction manager arjuna; sometimes if the application server crashes we have a lock on db pending.

      When we do WRKOBJLCK on the file, there are many *LCKSPC entries that can not be linked to any job. The job name and scope is displayed as *LCKSPC. The jobs cannot be ended.

      The only way I found to remove the lock is to write a standalone Java Program

       public static void main(String[] args) {
       // TODO Auto-generated method stub
       try {
       Class.forName("com.ibm.as400.access.AS400JDBCXADataSource");
       AS400JDBCXADataSource xads = new AS400JDBCXADataSource("server","user","password");
       xads.setTrace(true);
       XAConnection xaconn = xads.getXAConnection();
       XAResource xar = xaconn.getXAResource();
       System.out.println(xaconn);
       System.out.println(xar);
       String hex = "312D2D35336566643066663A3436653A34383433363465663A316435326232";
       byte[] xidb = new BigInteger(hex, 16).toByteArray();
       hex = "2D35336566643066663A3436653A34383433363465663A316435326434";
       byte[] branchb = new BigInteger(hex, 16).toByteArray();
       Xid xid = new MyXid(131075, xidb, branchb);
       //Xid[] xids = xar.recover(131075);
       xar.rollback(xid);
       xar.forget(xid);
       xaconn.close();
      
       } catch (Exception e) {
       e.printStackTrace();
       }
      
       }
      


      Is it normal ? Do we forgot something in our transaction manager configuration?

      Thanks in advance,
      max