用ireport写的报表,在同一个表中,连接两个数据库,但是另一个库使用的近义词,在上传时候,报出Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
(javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction .... Could not enlist in transaction on entering meta-aware object!;
后来上网查询,发现是因为没有设置jboss服务器在一个事务中访问多个数据库。
解决方式是修改下jboss的配置:
conf/jbossjta-properties.xml (JBoss-4.x) or conf/jbossts-properies.xml (JBoss 5)
在<properties depends="arjuna" name="jta">
节点下增加:
<!-- 支持一个事务中包括多个数据源 -->
<property name="com.arjuna.ats.jta.allowMultipleLastResources" value="true"/>
(javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction .... Could not enlist in transaction on entering meta-aware object!;
后来上网查询,发现是因为没有设置jboss服务器在一个事务中访问多个数据库。
解决方式是修改下jboss的配置:
conf/jbossjta-properties.xml (JBoss-4.x) or conf/jbossts-properies.xml (JBoss 5)
在<properties depends="arjuna" name="jta">
节点下增加:
<!-- 支持一个事务中包括多个数据源 -->
<property name="com.arjuna.ats.jta.allowMultipleLastResources" value="true"/>
本文介绍了使用IReport编写报表时遇到的问题,即在同一报表中连接两个数据库导致的异常,并详细记录了解决过程,包括调整JBoss服务器配置来支持一个事务内访问多个数据库的具体步骤。
1万+

被折叠的 条评论
为什么被折叠?



