报的错误如下:
log4j:WARN No appenders could be found for logger (org.jboss.util.NestedThrowable).log4j:WARN Please initialize the log4j system properly.org.jboss.tm.JBossTransactionRolledbackException: null; nested exception is: 
org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, 
GlobalId=lqgscp/15, BranchQual=, localId=15] status=STATUS_NO_TRANSACTION; - nested throwable: 
(javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=dyxx.TransinfoPK@3a2b7dd);
- nested throwable: (org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257,
GlobalId=lqgscp/15, BranchQual=, localId=15] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException:
Update failed. Expected one affected row: rowsAffected=0, id=dyxx.TransinfoPK@3a2b7dd))at org.jboss.ejb.plugins.TxInterceptorCMT.throwJBossException(TxInterceptorCMT.java:554)at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:491)at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:346)at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)at org.jboss.ejb.Container.invoke(Container.java:873)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:585)at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:585)at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)at sun.rmi.transport.Transport$1.run(Transport.java:153)at java.security.AccessController.doPrivileged(Native Method)at sun.rmi.transport.Transport.serviceCall(Transport.java:149)at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)at java.lang.Thread.run(Thread.java:595)Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=lqgscp/15, BranchQual=, localId=15] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=dyxx.TransinfoPK@3a2b7dd)at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:344)at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:486)... 29 moreCaused by: javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=dyxx.TransinfoPK@3a2b7ddat org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:155)at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:651)at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:413)at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:390)at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:743)at org.jboss.ejb.GlobalTxEntityMap$2.synchronize(GlobalTxEntityMap.java:134)at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:253)at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.beforeCompletion(GlobalTxEntityMap.java:302)at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1384)at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1076)at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:296)... 30 more

解决方案 »

  1.   

    下面是那个触发器,
    单独在查询分析器里执行(就是更改那个有触发器的字段),触发器完全起作用,当我在EJB里,把那个与触发器有关系的语句(ejb.setBooknum(booknum);)注释掉,整个EJB 的程序是没有问题的
    SET QUOTED_IDENTIFIER ON 
    GO
    SET ANSI_NULLS ON 
    GO
    /*创建修改变压器信息触发器*/
    ALTER   trigger T_update_trans 
    on transinfo
    for update
    as
    --停运变压器,由触发器维护停运信息表
    begin
      
      --修改变压器表本号,由触发器维护用户的表本号
      if update(booknum)
      begin
            begin tran trans1
            
      update userinfo set booknum = b.booknum
      from userinfo a,inserted b
      where a.substaid = b.substaid and a.lineid = b.lineid and a.transid = b.transid 
      
      commit tran trans1
      end
    end
    GO
    SET QUOTED_IDENTIFIER OFF 
    GO
    SET ANSI_NULLS ON 
    GO
    我在查询分析器里面测过那个触发器,一切正常,不知道怎么一到EJB里面就出问题呢?看了些资料,不知所云。还望这里的高手给解答一下啊。
    这是EJB里的那个修改函数:  
    public void updateTransinfo2(String substaid, String lineid, String transid,
                                   BigDecimal voltagein, Timestamp usedate,
                                   String transname, String copyerid,
                                   Integer transtypeid, Integer usetype,
                                   Integer transcapa, Integer booknum,
                                   String transaddr, String producecompany,
                                   String producecode, Timestamp producedate,
                                   Integer nousedays, Integer compoint,
                                   BigDecimal rating) {    TransinfoPK pk = new TransinfoPK(substaid, lineid, transid);
        try {
          TransinfoRemote ejb = Transinfohome.findByPrimaryKey(pk);      ejb.setVoltagein(voltagein);
          ejb.setUsedate(usedate);      ejb.setTransname(transname);
          ejb.setCopyerid(copyerid);
          ejb.setTranstypeid(transtypeid);
          ejb.setUsetype(usetype);      ejb.setTranscapa(transcapa);      ejb.setTransaddr(transaddr);
          ejb.setProducecompany(producecompany);
          ejb.setProducecode(producecode);      ejb.setProducedate(producedate);
          ejb.setNousedays(nousedays);
          ejb.setCompoint(compoint);
          ejb.setRating(rating);
          ejb.setBooknum(booknum);    }
        catch (RemoteException ex) {
        }
        catch (FinderException ex) {
        }
      }这是我在JBUILDER里生成的测试端:
      public static void main(String[] args) {
        dyxxSessTestClient1 client = new dyxxSessTestClient1();
        dyxxSess test=client.create();    String substaid="01";   //变电站编号
        String lineid="3030";     //线路编号
        String transid="005";    //变压器编号
        BigDecimal  voltagein=new BigDecimal("36.1");  //输入端电压
        Timestamp usedate = Timestamp.valueOf("2005-11-11 15:14:18.999999911");//投运日期    String transname="33";     //变压器名称
        String copyerid="01";      //抄表员编号
        String charcomid="02";        //供电所编号
        Integer transtypeid=Integer.valueOf(1);  //变压器类型
        Integer usetype=Integer.valueOf(0);      //专用公用标志    Integer transcapa=Integer.valueOf(33);  //固定容量
        Integer booknum=Integer.valueOf(33);    //表本号
        String transaddr="33";      //安装地址
        String producecompany="33"; //生产厂家
        String producecode="33";    //出厂编号
        Timestamp producedate = Timestamp.valueOf("2005-08-08 15:14:18.999999911"); //出厂日期
        Integer nousedays=Integer.valueOf(33);      //运行天数
        Integer compoint=Integer.valueOf(0);
            BigDecimal rating=new BigDecimal("0.5555");
    //        BigDecimal rating=null;
            try {
              test.updateTransinfo2(
                  substaid, lineid, transid,
                  voltagein, usedate,
                  transname, copyerid, transtypeid,
                  usetype, transcapa,booknum
                  , transaddr,
                  producecompany, producecode,
                  producedate, nousedays, compoint, rating
                  );
            }
            catch (Exception ex) {
              ex.printStackTrace();
            }  }当我在EJB 的public void updateTransinfo2(..){..}里 把    ejb.setBooknum(booknum);这句话注释掉以后,运行整个测试端没有问题,其余的字段也能够修改。如果有这句话,在测试端就会报上面的错误。update transinfo set booknum=999 where substaid='01' and lineid='3030' and transid='001' 
    这是我在查询分析器里单独更改那个有触发器的字段,触发器是可以正常工作的还望高手赐教
      

  2.   

    vacuumboy(菜鸟依旧)  能说的详细点吗,我不是很明白
      

  3.   

    触发器改成
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_NULLS ON
    GO
    /*创建修改变压器信息触发器*/
    ALTER trigger T_update_trans
    on transinfo
    for update
    as
    --停运变压器,由触发器维护停运信息表
    begin--修改变压器表本号,由触发器维护用户的表本号
    if update(booknum)
    beginupdate userinfo set booknum = b.booknum
    from userinfo a,inserted b
    where a.substaid = b.substaid and a.lineid = b.lineid and a.transid = b.transidend
    end
      

  4.   

    这是我改过后的触发器:SET QUOTED_IDENTIFIER ON 
    GO
    SET ANSI_NULLS ON 
    GO
    ALTER  trigger T_update_transon transinfo
    for update
    as
    --停运变压器,由触发器维护停运信息表
    begin  if update(booknum)
      begin
            begin tran trans1
            
       update userinfo set booknum = b.booknum
       from userinfo a,inserted b
       where a.substaid = b.substaid and a.lineid = b.lineid and a.transid = b.transid 
      
       commit tran trans1
      end
    end
    GO
    SET QUOTED_IDENTIFIER OFF 
    GO
    SET ANSI_NULLS ON 
    GO问题依旧:log4j:WARN No appenders could be found for logger (org.jboss.util.NestedThrowable).log4j:WARN Please initialize the log4j system properly.org.jboss.tm.JBossTransactionRolledbackException: null; nested exception is: 
    org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=lqgscp/15, BranchQual=, localId=15] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=3, id=dyxx.TransinfoPK@40d1745); - nested throwable: (org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=lqgscp/15, BranchQual=, localId=15] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=3, id=dyxx.TransinfoPK@40d1745)) at org.jboss.ejb.plugins.TxInterceptorCMT.throwJBossException(TxInterceptorCMT.java:554) at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:491) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:346) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122) at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624) at org.jboss.ejb.Container.invoke(Container.java:873) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) at org.jboss.mx.server.Invocation.invoke(Invocation.java:72) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644) at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805) at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294) at sun.rmi.transport.Transport$1.run(Transport.java:153) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:149) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707) at java.lang.Thread.run(Thread.java:595)Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=lqgscp/15, BranchQual=, localId=15] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=3, id=dyxx.TransinfoPK@40d1745) at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:344) at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:486) ... 29 moreCaused by: javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=3, id=dyxx.TransinfoPK@40d1745 at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:155) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:651) at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:413) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:390) at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:743) at org.jboss.ejb.GlobalTxEntityMap$2.synchronize(GlobalTxEntityMap.java:134) at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:253) at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.beforeCompletion(GlobalTxEntityMap.java:302) at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1384) at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1076) at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:296) ... 30 more
      

  5.   

    会不会与 EJB 有关系,我猜的
      

  6.   

    不是跟你说了,要把begin tran trans1去掉,EJB每次的操作都是当成事务来处理,你的触发器又是一个事务,这样当然会有问题。
    关键是begin tran trans1和commit tran trans1要去掉
      

  7.   

    遵上所述,改过后问题依旧,另外,我这个触发器是改动的 userinfo 表里的内容,同时,在userinfo 表中,如果booknum这个字段被改动,也要执行一个触发器
    如下(userinfo 表中的触发器): SET QUOTED_IDENTIFIER ON 
    GO
    SET ANSI_NULLS ON 
    GO/*创建修改客户信息触发器*/
    ALTER     trigger T_update_user 
    on userinfo
    for update
    as
    begin
     --修改用户表本号,由触发器维护电表的表本号
      if update(booknum) and update(userid) --迁址引起的
      begin
      /*
       update copyinfo set booknum = (select booknum from inserted)
       where userid = (select userid from deleted)
       */
      
       update primaryinfo set booknum =  (select booknum from inserted)
       where userid = (select userid from deleted)
      
       update subordinfo set booknum = (select booknum from inserted)
       where userid = (select userid from deleted)
      
    update ammeterinfo set booknum = (select booknum from inserted)
       where userid = (select userid from deleted)
      
    update copymodiinfo set booknum = (select booknum from inserted)
       where userid = (select userid from deleted)
      
      end
      if update(booknum) and (not update(userid)) --更改变压器的表本引起的
      begin

       update copyinfo set booknum = inserted.booknum
     from inserted 
       where copyinfo.userid = inserted.userid
      
       update primaryinfo set booknum = inserted.booknum from inserted
       where primaryinfo.userid = inserted.userid
      
       update subordinfo set booknum = inserted.booknum from inserted
       where subordinfo.userid = inserted.userid
      
    update ammeterinfo set booknum = inserted.booknum from inserted
       where ammeterinfo.userid = inserted.userid
      
    update copymodiinfo set booknum = inserted.booknum from inserted
       where copymodiinfo.userid = inserted.userid
      
      end
      --修改用户相对号、绝对号触发更改电表读数信息表、计费销账从表、计费销账主表中的用户相对号、绝对号
      --(电表信息、电价信息、副变压器信息中的在修改窗口更改)
      if update(userid)
      begin
            /*2006-09-14 修改,由于在更改线路时,电表信息需要删除后再插入,删除电表时触发器将该电表的
    读数信息一并删除,所以出现了无电表读数问题,读数表在修改客户表号时在程序中处理*/
    /*
       update copyinfo set userid = (select userid from inserted)
       where userid = (select userid from deleted)
       */
      
       update primaryinfo set userid = (select userid from inserted),
    substaid = (select left(userid,2) from inserted),
    lineid = (select substring(userid,3,4) from inserted),
    transid = (select substring(userid,7,3) from inserted)
       where userid = (select userid from deleted)
      
       update subordinfo set userid = (select userid from inserted),
    substaid = (select left(userid,2) from inserted),
    lineid = (select substring(userid,3,4) from inserted),
    transid = (select substring(userid,7,3) from inserted)
       where userid = (select userid from deleted)
      
       update bankmodiinfo set userid = (select userid from inserted)
       where userid = (select userid from deleted)
      
       update userpricemodiinfo set userid = (select userid from inserted)
       where userid = (select userid from deleted)
      
       update copymodiinfo set userid = (select userid from inserted)
       where userid = (select userid from deleted)
      
      end
      
      if update(usercomparid)
      begin
      
       update userpriceinfo set usercomparid = (select usercomparid from inserted)
       where usercomparid = (select usercomparid from deleted)
      
       update copyinfo set usercomparid = (select usercomparid from inserted)
       where usercomparid = (select usercomparid from deleted)
      
       update primaryinfo set usercomparid = (select usercomparid from inserted)
    where usercomparid = (select usercomparid from deleted)
      
       update subordinfo set usercomparid = (select usercomparid from inserted)
    where usercomparid = (select usercomparid from deleted)
      
       update bankmodiinfo set usercomparid = (select usercomparid from inserted)
    where usercomparid = (select usercomparid from deleted)
      
       update copymodiinfo set usercomparid = (select usercomparid from inserted)
    where usercomparid = (select usercomparid from deleted)
      
      end
      
      --修改支付方式时,需要修改计费主表中有欠费记录的支付方式,如果为发送银行,需提示用户等接收到银行数据销账后再修改
      if update(paymodid)
      begin
      
    if ((5 = (select paymodid from deleted)) and  (6 = (select paymodid from inserted))) --银行收据改为银行普票时,需要将以前银行代扣的也改为普票
    update primaryinfo set paymodid = b.paymodid
       from primaryinfo a,inserted b
       where a.userid = b.userid and ((a.comfeeflag = 0 and (a.cancaccflag = 0 or a.cancaccflag = 2))
      or (a.comfeeflag = 1 and a.cancaccflag = 2 and (a.bankid is not null)))
    else
       update primaryinfo set paymodid = b.paymodid
       from primaryinfo a,inserted b
       where a.userid = b.userid and a.comfeeflag = 0 
       and (a.cancaccflag = 0 or a.cancaccflag = 2)
      
      endendGO
    SET QUOTED_IDENTIFIER OFF 
    GO
    SET ANSI_NULLS ON 
    GO
      

  8.   

    JBOSS 下的日志2007-01-16 15:07:05,109 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=sa, password=--hidden--}
    2007-01-16 15:07:05,109 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Transinfo] Executing SQL: SELECT statusflag, nousedate, nousedays, charcomid, compoint, usedate, transtypeid, usetype, transcapa, voltagein, oiltype, transname, copyerid, feeerid, booknum, transaddr, producecompany, producecode, producedate, sparefield1, sparefield2, rating FROM Transinfo WHERE (substaid=? AND lineid=? AND transid=?)
    2007-01-16 15:07:05,125 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.Transinfo] Executing SQL: UPDATE Transinfo SET nousedays=?, usedate=?, transtypeid=?, transcapa=?, voltagein=?, transname=?, copyerid=?, booknum=?, transaddr=?, producecompany=?, producecode=?, producedate=?, rating=? WHERE substaid=? AND lineid=? AND transid=?
    2007-01-16 15:07:05,328 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException in method: public abstract void dyxx.dyxxSess.updateTransinfo2(java.lang.String,java.lang.String,java.lang.String,java.math.BigDecimal,java.sql.Timestamp,java.lang.String,java.lang.String,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.String,java.lang.String,java.lang.String,java.sql.Timestamp,java.lang.Integer,java.lang.Integer,java.math.BigDecimal) throws java.rmi.RemoteException, causedBy:
    org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=lqgscp/17, BranchQual=, localId=17] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=3, id=dyxx.TransinfoPK@40d1745)
    at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:344)
    at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:486)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:346)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
    at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=3, id=dyxx.TransinfoPK@40d1745
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:155)
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:651)
    at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:413)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:390)
    at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:743)
    at org.jboss.ejb.GlobalTxEntityMap$2.synchronize(GlobalTxEntityMap.java:134)
    at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:253)
    at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.beforeCompletion(GlobalTxEntityMap.java:302)
    at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1384)
    at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1076)
    at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:296)
    ... 29 more
      

  9.   

    又测了一遍,当我把userinfo 里的 触发器删掉,EJB 执行的没有错误,
    当我加上 userinfo 里的触发器,就会报错,
    两个触发器联动,不管用??