Sealyu

--- 博客已迁移至: http://www.sealyu.com/blog

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  618 随笔 :: 87 文章 :: 225 评论 :: 0 Trackbacks
这两天在作seam的时候不时遇到“org.jboss.util.NestedSQLException: Transaction is not active”的错误信息,后来到jboss的wiki上发现了问题的原因和解决方法:

How do I set the Transaction Timeout?

Transaction timeout (unit is always seconds) can be configured in various ways:

This argument is the same no matter if you are using JBossTM(<=4.0.5) or JBossJTA-Arjuna(>=4.2).

  • Globally: You can change this behavior globally by modifying the TransactionManagerService in /conf/jboss-service.xml (or /deploy/jta-service.xml for 4.0.3)

Version <= 4.0.5

This part is the same for either JBossTM or JBossJTA and is the same for ejb2 and ejb3

  • Per-method basis: Modifying the <transaction-timeout> element inside the <method> element of a session or entity bean. This is located in the META-INF/jboss.xml deployment descriptor of a session bean. When the transaction timeout is specified at the method level, it overrides the default timeout. Further information about this element can be found in jboss-x.x.x/docs/dtd/jboss_4_0.dtd. Example taken from the testsuite:

  • Using BMT: Calling javax.transaction.UserTransaction.setTransactionTimeout(int seconds). Please, be aware that this only applies to transactions started after this invocation on the same thread. Example:

@TransactionTimeout(1500)


posted on 2009-05-18 10:01 seal 阅读(2272) 评论(0)  编辑  收藏 所属分类: Java基础web服务器Seam

只有注册用户登录后才能发表评论。


网站导航: