记得ejb有个设置tansaction的地方,如果required的话,
ejb containner自己处理事务的提交回滚,你查查你的设置
ejb containner自己处理事务的提交回滚,你查查你的设置
解决方案 »
- ————lucene3.5 全文检索案例————0.1秒检索60万数据
- java写入一个原本存在的CSV文件。
- Struts2怎么取得Action中传来的实体????
- iBatis中resultMap.急求
- 用servlet后,登录时怎么把用户名保存到全局对象
- wsdl2生成本地类后运行代码出错,高手来看下
- org.hibernate.annotations.Entity和javax.persistence.Entity 关系
- 请问什么是POJO?在书写一个POJO的时候有什么规范么?
- 急问大虾如何在java中判断一个字符串是否在一个字符串数组当中呢?
- jb7配置wl7,不行啊!
- 关于STRUTS,如果在JSP页面循环显示记录?
- CMP简单问题, 请帮忙
{
UserTransaction ut = sessionContext.getUserTransaction(); Call_updateSQL(bufSql.toString()); String sq1 = "inset into MS_USER_VERIFY(ID) values ('www')";
Call_updateSQL(sq1);
ut.begin();
ut.commit();
}catch(Exception ex)
{
try
{
UserTransaction ut = this.sessionContext.getUserTransaction();
ut.rollback();
}catch(Exception e)
{
System.out.println("The rollback error is"+e);
}
System.out.println("The commit error is"+ex);
return;
} }
现在错误如下:
The rollback error isjava.lang.IllegalStateException: Transaction does not exist
try
{
ut = sessionContext.getUserTransaction();
ut.begin();
Call_updateSQL(bufSql.toString()); String sq1 = "inset into MS_USER_VERIFY(ID) values ('www')";
Call_updateSQL(sq1);
ut.commit();
}catch(Exception ex)
{
try
{
ut.rollback();
}catch(Exception e)
{
System.out.println("The rollback error is"+e);
}
System.out.println("The commit error is"+ex);
return;
} }这样应该可以了
The commit error is java.lang.NullPointerException
现在式这个!
java.lang.IllegalStateException: Transaction does not exist
System.out.println(bufSql.toString());
UserTransaction ut = sessionContext.getUserTransaction();
ut.begin();
Call_updateSQL(bufSql.toString());
ut.commit();
}catch(Exception ex)
{
try
{
UserTransaction ut = sessionContext.getUserTransaction();
ut.rollback();
throw ex;
}catch(Exception e)
{
System.out.println("The rollback error is"+e);
}
System.out.println("The commit error is "+ex);
}
The rollback error isjava.lang.NullPointerException
The commit error is java.lang.NullPointerException
System.out.println(bufSql.toString());
UserTransaction ut = sessionContext.getUserTransaction();
ut.begin();
Call_updateSQL(bufSql.toString());
ut.commit();
}catch(Exception ex)
{
try
{
ex.printStack();
if (ut!=null) ut.rollback();
throw ex;
}catch(Exception e)
{
System.out.println("The rollback error is"+e);
}
System.out.println("The commit error is "+ex);
}