`
momoko8443
  • 浏览: 36404 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

第二部分spring+hibernate+jta 分布式事务Demo

阅读更多

0、设计分布式数据库,修改第一部分的例子。先将db1中的user1表中的记录清除,把user2表drop掉,然后create一个新的database db2来模拟分布式数据库,在db2中新建一张表user2,结构和user1一致。接下来的操作就是同时对2个数据库的2张表进行操作了。clip_image001

clip_image003clip_image005

1、DAO接口、DAOImpl实现,Service接口、ServiceImpl实现都不用去动它,为使第一次测试时事务顺利提交,我们把第一部分中对于serviceImpl中insert方法中故意制造的困难去除。clip_image006

——————————————————————————————

文件:class User1AndUser2ServiceImpl.java

代码:

public void insertUser1AndUser2(User1 user) {

try{

System.out.println("insertUser1AndUser2 方法开始执行");

User1 insertedUser1=user1DAOImpl.insertUser1(user);

User2 user2=new User2();

//String tmp="制造困难制造困难制造困难制造困难制造困难制造困难制造困难制造困难制造困难制造困难制造困难制造困难";

//user2.setName(insertedUser1.getName()+tmp);

user2.setName(insertedUser1.getName());

user2DAOImpl.insertUser2(user2);

}

catch(DataAccessException e){

System.err.println("service 抛出异常");

throw e;

}

}

——————————————————————————————————————————

2、spring是不能直接管理分布式事务的,需要管理的话就得借助jta,但是jta又不能运行在tomcat这个容器中,于是我们就要用到AtomikosTransactionsEssentials这个第三方jar包来提供jta支持。AtomikosTransactionsEssentials可以从http://www.atomikos.com下载,当然我这里也提供这些类包的ftp下载(ftp下载,勾选连接到服务器,用户名: momo 密码 momoko8443)。解压zip文件后,我们从dist文件夹中拷贝几个jar包复制到工程中的lib下。如果你不使用spring管理hibernate,则把hibernate的包也拷上

clip_image008clip_image009

3、修改applicationContext.xml,由于database的增加,所以第一部分代码中的一个dataSource+一个sessionFactory的配置肯定不能满足多数据库的需求。这里我们要配置2个dataSource和2个sessionFactory。分别来管理起db1和db2。

由于要使用jta管理事务,dataSource就必须使用实现了javax.sql.XADataSource接口的连接池来连接,AtomikosTransactionsEssentials为我们提供了一个名为SimpleDataSourceBean的连接池(名字有点怪),废话不多说了,直接看修改的dataSource和sessionFactory,注意这里的数据库必须是mysql5.0以上,且驱动也要5.0以上否则不提供XADataSource支持。另外还有个叫Xapool的连接池也是支持xadatasource的,你可以试试看。clip_image010

——————————————————————————————————————————

文件:applicationContext.xml

配置:

<bean id="dataSource1" class="com.atomikos.jdbc.DataSourceBean">

<property name="uniqueResourceName"><value>db1</value></property>

<property name="xaDataSourceClassName"><value>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</value></property>

<property name="xaDataSourceProperties">

<value>URL=jdbc:mysql://localhost:3306/db1;user=root;password=root</value>

</property>

<property name="exclusiveConnectionMode"><value>true</value></property>

<property name="connectionPoolSize"><value>3</value></property>

<property name="validatingQuery"><value>SELECT 1</value></property>

</bean>

<bean id="sessionFactory1"

class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

<property name="dataSource">

<ref bean="dataSource1" />

</property>

<property name="hibernateProperties">

<props>

<prop key="hibernate.dialect">

org.hibernate.dialect.MySQLDialect

</prop>

</props>

</property>

<property name="mappingResources">

<list>

<value>com/zhiku/vo/User1.hbm.xml</value>

</list>

</property>

</bean>

————————————————————————————————————————

第二对连接db2的配置也是一样的,就是把出现1的地方都替换成2

————————————————————————————

文件:applicationContext.xml

配置:

<bean id="dataSource2" class="com.atomikos.jdbc.DataSourceBean">

<property name="uniqueResourceName"><value>db2</value></property>

<property name="xaDataSourceClassName"><value>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</value></property>

<property name="xaDataSourceProperties">

<value>URL=jdbc:mysql://localhost:3306/db2;user=root;password=root</value>

</property>

<property name="exclusiveConnectionMode"><value>true</value></property>

<property name="connectionPoolSize"><value>3</value></property>

<property name="validatingQuery"><value>SELECT 1</value></property>

</bean>

<bean id="sessionFactory2"

class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

<property name="dataSource">

<ref bean="dataSource2" />

</property>

<property name="hibernateProperties">

<props>

<prop key="hibernate.dialect">

org.hibernate.dialect.MySQLDialect

</prop>

</props>

</property>

<property name="mappingResources">

<list>

<value>com/zhiku/vo/User2.hbm.xml</value>

</list>

</property>

</bean>

————————————————————————————————————————————

4、继续修改applicationContext.xml,现在是关键所在,开始添加jta事务管理了。注意看代码了,首先定一个atomikos提供的transactionManagerclip_image011

——————————————————————————————————

文件:applicationContext.xml

配置:

<bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close">

<property name="forceShutdown"><value>true</value></property>

</bean>

————————————————————————————

再定一个atomikos对UserTransaction接口的实现clip_image012

——————————————————————————

文件:applicationContext.xml

配置:

<bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">

<property name="transactionTimeout"><value>300</value></property>

</bean>

————————————————————————

接着把第一部分中用到的hibernateTransactionManager进行大换血,由于这里不是由spring通过hibernate来管理事务了,而是由jta管理因此class要换掉。transactionManager和userTransaction接口的具体实现就注入之前声明的2个bean,

看到这里是不是有点晕?clip_image013,脑子里clip_image014。正常正常,先死记硬背

————————————————————————————

文件:applicationContext.xml

配置:

<bean id="hibernateTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">

<property name="transactionManager">

<ref local="atomikosTransactionManager"/>

</property>

<property name="userTransaction">

<ref local="atomikosUserTransaction"/>

</property>

</bean>

——————————————————————————————

user1DAOImpl和user2DAOImpl的sessionFactory属性稍作修改注入新的sessionFactory。user2DAOImpl类似,这里就不给出代码了。clip_image015

——————————————————————————————

文件:applicationContext.xml

配置:

<bean id="user1DAOImpl" class="com.zhiku.dao.impl.User1DAOImpl">

<property name="sessionFactory">

<ref local="sessionFactory1"/>

</property>

</bean>

————————————————————————————

5、映射文件可以重新生成一下,也可以把User2.hbm.xml中的catalog="db1"改成db2就可以不必重新生成而套用原来的

<class name="com.zhiku.vo.User2" table="user2" catalog="db2">

其他的都不必修改

接下来,run application。看下控制台,很好,正如我们期望的一样,第一次测试时,事务正常提交了。clip_image016

clip_image018

看下数据库,果然,2个db中user表都被“插入”clip_image019一条记录。如下图所示:

clip_image020

clip_image021,不要意思上错图了。如下图所示:

clip_image023

clip_image025

6、按照管理,接下来就是应该测roll back了,好,给它制造困难,把serviceImpl中的“困难”加上。clip_image026 Run application

clip_image028

看一下控制台输出,果然抛出了异常clip_image029

clip_image031

再观察下数据库中的记录。OK!roll back成功!clip_image032

clip_image034

clip_image036

7、至此分布式事务管理demo演示完毕,2个demo都是演示性质的,知侧重于配置和实现,至于其中的原理,由于我能力有限不能表述的很清楚,你可以查看spring的api文档进行探索。clip_image037,谢谢观赏。

ps.这里同样给出第二部分工程的代码下载(ftp下载,勾选连接到服务器,用户名: momo 密码 momoko8443)

分享到:
评论
15 楼 zhaoshijie 2013-03-26  
还需要什么jar包,跑步起来呢,请指教啊   急用 ...
14 楼 poolok 2012-04-16  
感谢群主分享,我目前的项目是想分成 两块 基础模块 权限 用户之类 使用oracle。
然后 业务模块 连接 其他类型数据 如mysql sql2005之类的。研究一下你的方法。看能不能实现 我的需求。楼主如果方便 加一下我的QQ516167911 好向你咨询一下
13 楼 momoko8443 2011-12-02  
对不起大家了!楼主我已经快4年没有搞java了! 转前台技术了!
希望研究出来的同学帮助不会的同学哦
12 楼 hezhiyu 2011-11-28  
hezhiyu 写道
楼主,我想在急需做个demo,不过总是报错,您能给我一份完整的工程所有的jar包吗,因为我下载的你这个demo是没有jar包的,谢谢你,我的邮箱是hzyshr@126.com

不用了楼主,我搞出来了,大家有啥问题也可以问我哈,我很乐意帮忙的,我的邮箱:hzyshr@126.com
11 楼 hezhiyu 2011-11-26  
楼主,我想在急需做个demo,不过总是报错,您能给我一份完整的工程所有的jar包吗,因为我下载的你这个demo是没有jar包的,谢谢你,我的邮箱是hzyshr@126.com
10 楼 zjwanly 2011-10-31  
可不可以把这个项目的jar包发给我,谢谢你!我的邮箱:1620968451@qq.com
9 楼 liushu1234 2011-05-30  
谢谢分享啊,我先这么用着,刚开始用jotm,调了半天都没做好。下次试试把这个数据库连接池换为xapool试试。
8 楼 rmn190 2009-03-02  
请教楼主一个问题:在Oracle里, 一个database下的两个schema的数据被一个系统操作, 这时怎么配置事务管理?

这时的JDBC连接数据库里的URL是一样的.

7 楼 antonie1111 2008-09-26  
非常感谢楼主,很详细.
6 楼 liuzhengd9 2008-07-02  
楼主,我按照你的部署测了一下,出现了上面的错误,不知是怎么回事?
我配置atomikos一直出现这种错误
主要是用hibernate3.2.6出现的
5 楼 liuzhengd9 2008-07-02  
2008-07-02 22:14:37,781  INFO [main] (AbstractApplicationContext.java:412) - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@b0f13d: display name [org.springframework.context.support.ClassPathXmlApplicationContext@b0f13d]; startup date [Wed Jul 02 22:14:37 CST 2008]; root of context hierarchy
2008-07-02 22:14:37,828 DEBUG [main] (ClassUtils.java:183) - Class [edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap] or one of its dependencies is not present: java.lang.ClassNotFoundException: edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap
2008-07-02 22:14:37,890  INFO [main] (XmlBeanDefinitionReader.java:323) - Loading XML bean definitions from class path resource [applicationContext.xml]
2008-07-02 22:14:37,921 DEBUG [main] (DefaultDocumentLoader.java:72) - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
2008-07-02 22:14:38,062 DEBUG [main] (PluggableSchemaResolver.java:125) - Loading schema mappings from [META-INF/spring.schemas]
2008-07-02 22:14:38,078 DEBUG [main] (PluggableSchemaResolver.java:131) - Loaded schema mappings: {http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://www.springframework.org/schema/jms/spring-jms-2.5.xsd=org/springframework/jms/config/spring-jms-2.5.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd=org/directwebremoting/spring/spring-dwr-2.0.xsd, http://www.springframework.org/schema/jms/spring-jms.xsd=org/springframework/jms/config/spring-jms-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd}
2008-07-02 22:14:38,078 DEBUG [main] (PluggableSchemaResolver.java:114) - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-2.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-2.0.xsd
2008-07-02 22:14:38,218 DEBUG [main] (DefaultBeanDefinitionDocumentReader.java:86) - Loading bean definitions
2008-07-02 22:14:38,281 DEBUG [main] (AbstractBeanDefinitionReader.java:185) - Loaded 11 bean definitions from location pattern [applicationContext.xml]
2008-07-02 22:14:38,281  INFO [main] (AbstractApplicationContext.java:427) - Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@b0f13d]: org.springframework.beans.factory.support.DefaultListableBeanFactory@186768e
2008-07-02 22:14:38,281 DEBUG [main] (AbstractApplicationContext.java:431) - 11 beans defined in org.springframework.context.support.ClassPathXmlApplicationContext@b0f13d: display name [org.springframework.context.support.ClassPathXmlApplicationContext@b0f13d]; startup date [Wed Jul 02 22:14:37 CST 2008]; root of context hierarchy
2008-07-02 22:14:38,328 DEBUG [main] (AbstractApplicationContext.java:649) - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@80fa6f]
2008-07-02 22:14:38,328 DEBUG [main] (AbstractApplicationContext.java:673) - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@1292d26]
2008-07-02 22:14:38,328  INFO [main] (DefaultListableBeanFactory.java:414) - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@186768e: defining beans [dataSource1,sessionFactory1,dataSource2,sessionFactory2,atomikosTransactionManager,atomikosUserTransaction,user1DAOImpl,user2DAOImpl,user1AndUser2ServiceImpl,hibernateTransactionManager,user1AndUser2ServiceProxy]; root of factory hierarchy
2008-07-02 22:14:38,328 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'dataSource1'
2008-07-02 22:14:38,328 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'dataSource1'
2008-07-02 22:14:38,421 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'dataSource1' to allow for resolving potential circular references
2008-07-02 22:14:38,468 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'dataSource1'
2008-07-02 22:14:38,468 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'sessionFactory1'
2008-07-02 22:14:38,468 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'sessionFactory1'
2008-07-02 22:14:38,500 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'sessionFactory1' to allow for resolving potential circular references
2008-07-02 22:14:38,500 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'dataSource1'
2008-07-02 22:14:38,515 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:1365) - Invoking afterPropertiesSet() on bean with name 'sessionFactory1'
2008-07-02 22:14:38,515  INFO [main] (Environment.java:514) - Hibernate 3.2.6
2008-07-02 22:14:38,531  INFO [main] (Environment.java:547) - hibernate.properties not found
2008-07-02 22:14:38,531  INFO [main] (Environment.java:681) - Bytecode provider name : cglib
2008-07-02 22:14:38,531  INFO [main] (Environment.java:598) - using JDK 1.4 java.sql.Timestamp handling
2008-07-02 22:14:38,703 DEBUG [main] (DTDEntityResolver.java:38) - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
2008-07-02 22:14:38,703 DEBUG [main] (DTDEntityResolver.java:40) - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
2008-07-02 22:14:38,703 DEBUG [main] (DTDEntityResolver.java:50) - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
2008-07-02 22:14:38,828  INFO [main] (HbmBinder.java:300) - Mapping class: com.zhiku.vo.User1 -> my_user
2008-07-02 22:14:38,843 DEBUG [main] (HbmBinder.java:1267) - Mapped property: id -> user_id
2008-07-02 22:14:38,843 DEBUG [main] (HbmBinder.java:1267) - Mapped property: name -> user_name
2008-07-02 22:14:38,843 DEBUG [main] (Configuration.java:1126) - processing extends queue
2008-07-02 22:14:38,843 DEBUG [main] (Configuration.java:1130) - processing collection mappings
2008-07-02 22:14:38,843 DEBUG [main] (Configuration.java:1141) - processing native query and ResultSetMapping mappings
2008-07-02 22:14:38,843 DEBUG [main] (Configuration.java:1149) - processing association property references
2008-07-02 22:14:38,859 DEBUG [main] (Configuration.java:1171) - processing foreign key constraints
2008-07-02 22:14:38,859  INFO [main] (LocalSessionFactoryBean.java:730) - Building new Hibernate SessionFactory
2008-07-02 22:14:38,859 DEBUG [main] (Configuration.java:1291) - Preparing to build session factory with filters : {}
2008-07-02 22:14:38,859 DEBUG [main] (Configuration.java:1126) - processing extends queue
2008-07-02 22:14:38,859 DEBUG [main] (Configuration.java:1130) - processing collection mappings
2008-07-02 22:14:38,859 DEBUG [main] (Configuration.java:1141) - processing native query and ResultSetMapping mappings
2008-07-02 22:14:38,859 DEBUG [main] (Configuration.java:1149) - processing association property references
2008-07-02 22:14:38,859 DEBUG [main] (Configuration.java:1171) - processing foreign key constraints
2008-07-02 22:14:38,937  INFO [main] (ConnectionProviderFactory.java:72) - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
2008-07-02 22:14:40,921  INFO [main] (SettingsFactory.java:89) - RDBMS: MySQL, version: 6.0.5-alpha-community
2008-07-02 22:14:40,921  INFO [main] (SettingsFactory.java:90) - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )
2008-07-02 22:14:40,937  INFO [main] (Dialect.java:152) - Using dialect: org.hibernate.dialect.MySQLDialect
2008-07-02 22:14:40,937  INFO [main] (TransactionFactoryFactory.java:34) - Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory
2008-07-02 22:14:40,953  INFO [main] (TransactionManagerLookupFactory.java:33) - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:143) - Automatic flush during beforeCompletion(): disabled
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:147) - Automatic session close at end of transaction: disabled
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:154) - JDBC batch size: 15
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:157) - JDBC batch updates for versioned data: disabled
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:162) - Scrollable result sets: enabled
2008-07-02 22:14:40,953 DEBUG [main] (SettingsFactory.java:166) - Wrap result sets: disabled
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:170) - JDBC3 getGeneratedKeys(): enabled
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:178) - Connection release mode: auto
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:202) - Maximum outer join fetch depth: 2
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:205) - Default batch fetch size: 1
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:209) - Generate SQL with comments: disabled
2008-07-02 22:14:40,953  INFO [main] (SettingsFactory.java:213) - Order SQL updates by primary key: disabled
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:217) - Order SQL inserts for batching: disabled
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:386) - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2008-07-02 22:14:40,968  INFO [main] (ASTQueryTranslatorFactory.java:24) - Using ASTQueryTranslatorFactory
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:225) - Query language substitutions: {}
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:230) - JPA-QL strict compliance: disabled
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:235) - Second-level cache: enabled
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:239) - Query cache: disabled
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:373) - Cache provider: org.hibernate.cache.NoCacheProvider
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:254) - Optimize cache for minimal puts: disabled
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:263) - Structured second-level cache entries: disabled
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:290) - Statistics: disabled
2008-07-02 22:14:40,968  INFO [main] (SettingsFactory.java:294) - Deleted entity synthetic identifier rollback: disabled
2008-07-02 22:14:40,984  INFO [main] (SettingsFactory.java:309) - Default entity-mode: pojo
2008-07-02 22:14:40,984  INFO [main] (SettingsFactory.java:313) - Named query checking : enabled
2008-07-02 22:14:41,015  INFO [main] (SessionFactoryImpl.java:161) - building session factory
2008-07-02 22:14:41,031 DEBUG [main] (SessionFactoryImpl.java:173) - Session factory constructed with filter configurations : {}
2008-07-02 22:14:41,031 DEBUG [main] (SessionFactoryImpl.java:177) - instantiating session factory with properties: {java.runtime.name=Java(TM) SE Runtime Environment, sun.boot.library.path=D:\Java\jre1.6.0_04\bin, java.vm.version=10.0-b19, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=CN, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=D:\workspace\myProject, java.runtime.version=1.6.0_04-b12, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, hibernate.current_session_context_class=org.springframework.orm.hibernate3.SpringSessionContext, java.endorsed.dirs=D:\Java\jre1.6.0_04\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\liuzheng\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.jnu.encoding=GBK, java.library.path=D:\Java\jre1.6.0_04\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\Borland\Delphi7\Bin;D:\Borland\Delphi7\Projects\Bpl\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Java\jdk1.6.0_04\bin;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;D:\apache-maven-2.0.9\bin;D:\StormII\Codec;D:\StormII, java.specification.name=Java Platform API Specification, java.class.version=50.0, sun.management.compiler=HotSpot Client Compiler, hibernate.transaction.factory_class=org.springframework.orm.hibernate3.SpringTransactionFactory, os.version=5.1, user.home=C:\Documents and Settings\liuzheng, user.timezone=Asia/Shanghai, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=GBK, java.specification.version=1.6, java.class.path=D:\workspace\myProject\WebRoot\WEB-INF\classes;D:\workspace\myProject\WebRoot\WEB-INF\lib\jstl.jar;D:\workspace\myProject\WebRoot\WEB-INF\lib\standard.jar;D:\workspace\MySpring\lib\log4j-1.2.15.jar;D:\workspace\MySpring\lib\dwr.jar;D:\workspace\MySpring\lib\aspectjweaver.jar;D:\workspace\MySpring\lib\cglib-nodep-2.1_3.jar;D:\workspace\MySpring\lib\spring.jar;D:\workspace\MySpring\lib\JTA\connector-1_5.jar;D:\workspace\MySpring\lib\JTA\jotm.jar;D:\workspace\MySpring\lib\JTA\jotm_jrmp_stubs.jar;D:\workspace\MySpring\lib\JTA\jta-spec1_0_1.jar;D:\workspace\MySpring\lib\JTA\xapool.jar;D:\workspace\MySpring\lib\hibernate3.jar;D:\workspace\MySpring\lib\commons-logging.jar;D:\workspace\MySpring\lib\commons-dbcp.jar;D:\workspace\MySpring\lib\aspectjrt.jar;D:\workspace\MySpring\lib\asm-2.2.3.jar;D:\workspace\MySpring\lib\asm-commons-2.2.3.jar;D:\workspace\MySpring\lib\asm-util-2.2.3.jar;D:\workspace\MySpring\lib\c3p0-0.9.1.2.jar;D:\workspace\MySpring\lib\aopalliance.jar;D:\workspace\MySpring\lib\commons-pool.jar;D:\workspace\MySpring\lib\dom4j-1.6.1.jar;D:\workspace\MySpring\lib\commons-collections.jar;D:\workspace\MySpring\lib\msbase.jar;D:\workspace\MySpring\lib\mssqlserver.jar;D:\workspace\MySpring\lib\msutil.jar;D:\workspace\MySpring\lib\spring-test.jar;D:\workspace\MySpring\lib\junit-4.4.jar;D:\workspace\MySpring\lib\ow_carol.jar;D:\workspace\MySpring\lib\howl.jar;D:\workspace\MySpring\lib\jotm_iiop_stubs.jar;D:\workspace\MySpring\lib\jts1_0.jar;D:\workspace\MySpring\lib\objectweb-datasource.jar;D:\workspace\MySpring\lib\atomikos\atomikos-util.jar;D:\workspace\MySpring\lib\atomikos\transactions.jar;D:\workspace\MySpring\lib\atomikos\transactions-api.jar;D:\workspace\MySpring\lib\atomikos\transactions-hibernate3.jar;D:\workspace\MySpring\lib\atomikos\transactions-jdbc.jar;D:\workspace\MySpring\lib\atomikos\transactions-jta.jar;D:\workspace\MySpring\lib\transactions-jdbc-deprecated.jar;D:\workspace\MySpring\lib\mysql-connector-java-5.1.6-bin.jar, user.name=liuzheng, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=D:\Java\jre1.6.0_04, hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.specification.vendor=Sun Microsystems Inc., user.language=zh, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, sharing, java.version=1.6.0_04, java.ext.dirs=D:\Java\jre1.6.0_04\lib\ext;C:\WINDOWS\Sun\Java\lib\ext, sun.boot.class.path=D:\Java\jre1.6.0_04\lib\resources.jar;D:\Java\jre1.6.0_04\lib\rt.jar;D:\Java\jre1.6.0_04\lib\sunrsasign.jar;D:\Java\jre1.6.0_04\lib\jsse.jar;D:\Java\jre1.6.0_04\lib\jce.jar;D:\Java\jre1.6.0_04\lib\charsets.jar;D:\Java\jre1.6.0_04\classes;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\activation.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\javax.servlet.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\javax.servlet.jsp.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\jboss-j2ee.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\jboss-jaxrpc.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\jboss-jsr77.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\jboss-saaj.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\mail.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\namespace.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\xml-apis.jar, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, hibernate.connection.provider_class=org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider, sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeLittle, sun.desktop=windows, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86}
2008-07-02 22:14:41,453 DEBUG [main] (AbstractEntityPersister.java:2743) - Static SQL for entity: com.zhiku.vo.User1
2008-07-02 22:14:41,453 DEBUG [main] (AbstractEntityPersister.java:2748) -  Version select: select user_id from db1.my_user where user_id =?
2008-07-02 22:14:41,453 DEBUG [main] (AbstractEntityPersister.java:2751) -  Snapshot select: select user1x_.user_id, user1x_.user_name as user2_0_ from db1.my_user user1x_ where user1x_.user_id=?
2008-07-02 22:14:41,453 DEBUG [main] (AbstractEntityPersister.java:2754) -  Insert 0: insert into db1.my_user (user_name, user_id) values (?, ?)
2008-07-02 22:14:41,453 DEBUG [main] (AbstractEntityPersister.java:2755) -  Update 0: update db1.my_user set user_name=? where user_id=?
2008-07-02 22:14:41,453 DEBUG [main] (AbstractEntityPersister.java:2756) -  Delete 0: delete from db1.my_user where user_id=?
2008-07-02 22:14:41,484 DEBUG [main] (EntityLoader.java:79) - Static select for entity com.zhiku.vo.User1: select user1x0_.user_id as user1_0_0_, user1x0_.user_name as user2_0_0_ from db1.my_user user1x0_ where user1x0_.user_id=?
2008-07-02 22:14:41,484 DEBUG [main] (EntityLoader.java:79) - Static select for entity com.zhiku.vo.User1: select user1x0_.user_id as user1_0_0_, user1x0_.user_name as user2_0_0_ from db1.my_user user1x0_ where user1x0_.user_id=?
2008-07-02 22:14:41,484 DEBUG [main] (EntityLoader.java:79) - Static select for entity com.zhiku.vo.User1: select user1x0_.user_id as user1_0_0_, user1x0_.user_name as user2_0_0_ from db1.my_user user1x0_ where user1x0_.user_id=? for update
2008-07-02 22:14:41,484 DEBUG [main] (EntityLoader.java:79) - Static select for entity com.zhiku.vo.User1: select user1x0_.user_id as user1_0_0_, user1x0_.user_name as user2_0_0_ from db1.my_user user1x0_ where user1x0_.user_id=? for update
2008-07-02 22:14:41,484 DEBUG [main] (EntityLoader.java:79) - Static select for entity com.zhiku.vo.User1: select user1x0_.user_id as user1_0_0_, user1x0_.user_name as user2_0_0_ from db1.my_user user1x0_ where user1x0_.user_id=? for update
2008-07-02 22:14:41,500 DEBUG [main] (CascadeEntityLoader.java:34) - Static select for action ACTION_MERGE on entity com.zhiku.vo.User1: select user1x0_.user_id as user1_0_0_, user1x0_.user_name as user2_0_0_ from db1.my_user user1x0_ where user1x0_.user_id=?
2008-07-02 22:14:41,500 DEBUG [main] (CascadeEntityLoader.java:34) - Static select for action ACTION_REFRESH on entity com.zhiku.vo.User1: select user1x0_.user_id as user1_0_0_, user1x0_.user_name as user2_0_0_ from db1.my_user user1x0_ where user1x0_.user_id=?
2008-07-02 22:14:41,500 DEBUG [main] (SessionFactoryObjectFactory.java:39) - initializing class SessionFactoryObjectFactory
2008-07-02 22:14:41,500 DEBUG [main] (SessionFactoryObjectFactory.java:76) - registered: 8a8a17cb1ae42004011ae420065c0000 (unnamed)
2008-07-02 22:14:41,500  INFO [main] (SessionFactoryObjectFactory.java:82) - Not binding factory to JNDI, no JNDI name configured
2008-07-02 22:14:41,500 DEBUG [main] (SessionFactoryImpl.java:308) - instantiated session factory
2008-07-02 22:14:41,500 DEBUG [main] (SessionFactoryImpl.java:392) - Checking 0 named HQL queries
2008-07-02 22:14:41,500 DEBUG [main] (SessionFactoryImpl.java:412) - Checking 0 named SQL queries
2008-07-02 22:14:41,500 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'sessionFactory1'
2008-07-02 22:14:41,500 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'dataSource2'
2008-07-02 22:14:41,500 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'dataSource2'
2008-07-02 22:14:41,500 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'dataSource2' to allow for resolving potential circular references
2008-07-02 22:14:41,515 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'dataSource2'
2008-07-02 22:14:41,515 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'sessionFactory2'
2008-07-02 22:14:41,515 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'sessionFactory2'
2008-07-02 22:14:41,515 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'sessionFactory2' to allow for resolving potential circular references
2008-07-02 22:14:41,515 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'dataSource2'
2008-07-02 22:14:41,515 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:1365) - Invoking afterPropertiesSet() on bean with name 'sessionFactory2'
2008-07-02 22:14:41,515 DEBUG [main] (DTDEntityResolver.java:38) - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
2008-07-02 22:14:41,515 DEBUG [main] (DTDEntityResolver.java:40) - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
2008-07-02 22:14:41,515 DEBUG [main] (DTDEntityResolver.java:50) - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
2008-07-02 22:14:41,546  INFO [main] (HbmBinder.java:300) - Mapping class: com.zhiku.vo.User2 -> my_user
2008-07-02 22:14:41,546 DEBUG [main] (HbmBinder.java:1267) - Mapped property: id -> user_id
2008-07-02 22:14:41,546 DEBUG [main] (HbmBinder.java:1267) - Mapped property: name -> nuser_ame
2008-07-02 22:14:41,546 DEBUG [main] (Configuration.java:1126) - processing extends queue
2008-07-02 22:14:41,546 DEBUG [main] (Configuration.java:1130) - processing collection mappings
2008-07-02 22:14:41,546 DEBUG [main] (Configuration.java:1141) - processing native query and ResultSetMapping mappings
2008-07-02 22:14:41,546 DEBUG [main] (Configuration.java:1149) - processing association property references
2008-07-02 22:14:41,546 DEBUG [main] (Configuration.java:1171) - processing foreign key constraints
2008-07-02 22:14:41,546  INFO [main] (LocalSessionFactoryBean.java:730) - Building new Hibernate SessionFactory
2008-07-02 22:14:41,546 DEBUG [main] (Configuration.java:1291) - Preparing to build session factory with filters : {}
2008-07-02 22:14:41,546 DEBUG [main] (Configuration.java:1126) - processing extends queue
2008-07-02 22:14:41,546 DEBUG [main] (Configuration.java:1130) - processing collection mappings
2008-07-02 22:14:41,546 DEBUG [main] (Configuration.java:1141) - processing native query and ResultSetMapping mappings
2008-07-02 22:14:41,546 DEBUG [main] (Configuration.java:1149) - processing association property references
2008-07-02 22:14:41,562 DEBUG [main] (Configuration.java:1171) - processing foreign key constraints
2008-07-02 22:14:41,562  INFO [main] (ConnectionProviderFactory.java:72) - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
2008-07-02 22:14:42,609  INFO [main] (SettingsFactory.java:89) - RDBMS: MySQL, version: 6.0.5-alpha-community
2008-07-02 22:14:42,609  INFO [main] (SettingsFactory.java:90) - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )
2008-07-02 22:14:42,609  INFO [main] (Dialect.java:152) - Using dialect: org.hibernate.dialect.MySQLDialect
2008-07-02 22:14:42,609  INFO [main] (TransactionFactoryFactory.java:34) - Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory
2008-07-02 22:14:42,609  INFO [main] (TransactionManagerLookupFactory.java:33) - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2008-07-02 22:14:42,609  INFO [main] (SettingsFactory.java:143) - Automatic flush during beforeCompletion(): disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:147) - Automatic session close at end of transaction: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:154) - JDBC batch size: 15
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:157) - JDBC batch updates for versioned data: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:162) - Scrollable result sets: enabled
2008-07-02 22:14:42,625 DEBUG [main] (SettingsFactory.java:166) - Wrap result sets: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:170) - JDBC3 getGeneratedKeys(): enabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:178) - Connection release mode: auto
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:202) - Maximum outer join fetch depth: 2
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:205) - Default batch fetch size: 1
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:209) - Generate SQL with comments: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:213) - Order SQL updates by primary key: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:217) - Order SQL inserts for batching: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:386) - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2008-07-02 22:14:42,625  INFO [main] (ASTQueryTranslatorFactory.java:24) - Using ASTQueryTranslatorFactory
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:225) - Query language substitutions: {}
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:230) - JPA-QL strict compliance: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:235) - Second-level cache: enabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:239) - Query cache: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:373) - Cache provider: org.hibernate.cache.NoCacheProvider
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:254) - Optimize cache for minimal puts: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:263) - Structured second-level cache entries: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:290) - Statistics: disabled
2008-07-02 22:14:42,625  INFO [main] (SettingsFactory.java:294) - Deleted entity synthetic identifier rollback: disabled
2008-07-02 22:14:42,640  INFO [main] (SettingsFactory.java:309) - Default entity-mode: pojo
2008-07-02 22:14:42,640  INFO [main] (SettingsFactory.java:313) - Named query checking : enabled
2008-07-02 22:14:42,640  INFO [main] (SessionFactoryImpl.java:161) - building session factory
2008-07-02 22:14:42,640 DEBUG [main] (SessionFactoryImpl.java:173) - Session factory constructed with filter configurations : {}
2008-07-02 22:14:42,640 DEBUG [main] (SessionFactoryImpl.java:177) - instantiating session factory with properties: {java.runtime.name=Java(TM) SE Runtime Environment, sun.boot.library.path=D:\Java\jre1.6.0_04\bin, java.vm.version=10.0-b19, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=CN, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=D:\workspace\myProject, java.runtime.version=1.6.0_04-b12, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, hibernate.current_session_context_class=org.springframework.orm.hibernate3.SpringSessionContext, java.endorsed.dirs=D:\Java\jre1.6.0_04\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\liuzheng\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.jnu.encoding=GBK, java.library.path=D:\Java\jre1.6.0_04\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\Borland\Delphi7\Bin;D:\Borland\Delphi7\Projects\Bpl\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Java\jdk1.6.0_04\bin;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;D:\apache-maven-2.0.9\bin;D:\StormII\Codec;D:\StormII, java.specification.name=Java Platform API Specification, java.class.version=50.0, sun.management.compiler=HotSpot Client Compiler, hibernate.transaction.factory_class=org.springframework.orm.hibernate3.SpringTransactionFactory, os.version=5.1, user.home=C:\Documents and Settings\liuzheng, user.timezone=Asia/Shanghai, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=GBK, java.specification.version=1.6, java.class.path=D:\workspace\myProject\WebRoot\WEB-INF\classes;D:\workspace\myProject\WebRoot\WEB-INF\lib\jstl.jar;D:\workspace\myProject\WebRoot\WEB-INF\lib\standard.jar;D:\workspace\MySpring\lib\log4j-1.2.15.jar;D:\workspace\MySpring\lib\dwr.jar;D:\workspace\MySpring\lib\aspectjweaver.jar;D:\workspace\MySpring\lib\cglib-nodep-2.1_3.jar;D:\workspace\MySpring\lib\spring.jar;D:\workspace\MySpring\lib\JTA\connector-1_5.jar;D:\workspace\MySpring\lib\JTA\jotm.jar;D:\workspace\MySpring\lib\JTA\jotm_jrmp_stubs.jar;D:\workspace\MySpring\lib\JTA\jta-spec1_0_1.jar;D:\workspace\MySpring\lib\JTA\xapool.jar;D:\workspace\MySpring\lib\hibernate3.jar;D:\workspace\MySpring\lib\commons-logging.jar;D:\workspace\MySpring\lib\commons-dbcp.jar;D:\workspace\MySpring\lib\aspectjrt.jar;D:\workspace\MySpring\lib\asm-2.2.3.jar;D:\workspace\MySpring\lib\asm-commons-2.2.3.jar;D:\workspace\MySpring\lib\asm-util-2.2.3.jar;D:\workspace\MySpring\lib\c3p0-0.9.1.2.jar;D:\workspace\MySpring\lib\aopalliance.jar;D:\workspace\MySpring\lib\commons-pool.jar;D:\workspace\MySpring\lib\dom4j-1.6.1.jar;D:\workspace\MySpring\lib\commons-collections.jar;D:\workspace\MySpring\lib\msbase.jar;D:\workspace\MySpring\lib\mssqlserver.jar;D:\workspace\MySpring\lib\msutil.jar;D:\workspace\MySpring\lib\spring-test.jar;D:\workspace\MySpring\lib\junit-4.4.jar;D:\workspace\MySpring\lib\ow_carol.jar;D:\workspace\MySpring\lib\howl.jar;D:\workspace\MySpring\lib\jotm_iiop_stubs.jar;D:\workspace\MySpring\lib\jts1_0.jar;D:\workspace\MySpring\lib\objectweb-datasource.jar;D:\workspace\MySpring\lib\atomikos\atomikos-util.jar;D:\workspace\MySpring\lib\atomikos\transactions.jar;D:\workspace\MySpring\lib\atomikos\transactions-api.jar;D:\workspace\MySpring\lib\atomikos\transactions-hibernate3.jar;D:\workspace\MySpring\lib\atomikos\transactions-jdbc.jar;D:\workspace\MySpring\lib\atomikos\transactions-jta.jar;D:\workspace\MySpring\lib\transactions-jdbc-deprecated.jar;D:\workspace\MySpring\lib\mysql-connector-java-5.1.6-bin.jar, user.name=liuzheng, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=D:\Java\jre1.6.0_04, hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.specification.vendor=Sun Microsystems Inc., user.language=zh, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, sharing, java.version=1.6.0_04, java.ext.dirs=D:\Java\jre1.6.0_04\lib\ext;C:\WINDOWS\Sun\Java\lib\ext, sun.boot.class.path=D:\Java\jre1.6.0_04\lib\resources.jar;D:\Java\jre1.6.0_04\lib\rt.jar;D:\Java\jre1.6.0_04\lib\sunrsasign.jar;D:\Java\jre1.6.0_04\lib\jsse.jar;D:\Java\jre1.6.0_04\lib\jce.jar;D:\Java\jre1.6.0_04\lib\charsets.jar;D:\Java\jre1.6.0_04\classes;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\activation.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\javax.servlet.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\javax.servlet.jsp.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\jboss-j2ee.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\jboss-jaxrpc.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\jboss-jsr77.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\jboss-saaj.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\mail.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\namespace.jar;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.5.0.zmyeclipse650200806\data\libraryset\1.4\xml-apis.jar, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, hibernate.connection.provider_class=org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider, sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeLittle, sun.desktop=windows, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86}
2008-07-02 22:14:42,640 DEBUG [main] (AbstractEntityPersister.java:2743) - Static SQL for entity: com.zhiku.vo.User2
2008-07-02 22:14:42,640 DEBUG [main] (AbstractEntityPersister.java:2748) -  Version select: select user_id from db2.my_user where user_id =?
2008-07-02 22:14:42,640 DEBUG [main] (AbstractEntityPersister.java:2751) -  Snapshot select: select user2x_.user_id, user2x_.nuser_ame as nuser2_2_ from db2.my_user user2x_ where user2x_.user_id=?
2008-07-02 22:14:42,640 DEBUG [main] (ANo properties path set - looking for transactions.properties in classpath...
Using init file: /D:/workspace/myProject/WebRoot/WEB-INF/classes/transactions.properties
bstractEntityPersister.java:2754) -  Insert 0: insert into db2.my_user (nuser_ame, user_id) values (?, ?)
2008-07-02 22:14:42,656 DEBUG [main] (AbstractEntityPersister.java:2755) -  Update 0: update db2.my_user set nuser_ame=? where user_id=?
2008-07-02 22:14:42,656 DEBUG [main] (AbstractEntityPersister.java:2756) -  Delete 0: delete from db2.my_user where user_id=?
2008-07-02 22:14:42,656 DEBUG [main] (EntityLoader.java:79) - Static select for entity com.zhiku.vo.User2: select user2x0_.user_id as user1_2_0_, user2x0_.nuser_ame as nuser2_2_0_ from db2.my_user user2x0_ where user2x0_.user_id=?
2008-07-02 22:14:42,656 DEBUG [main] (EntityLoader.java:79) - Static select for entity com.zhiku.vo.User2: select user2x0_.user_id as user1_2_0_, user2x0_.nuser_ame as nuser2_2_0_ from db2.my_user user2x0_ where user2x0_.user_id=?
2008-07-02 22:14:42,656 DEBUG [main] (EntityLoader.java:79) - Static select for entity com.zhiku.vo.User2: select user2x0_.user_id as user1_2_0_, user2x0_.nuser_ame as nuser2_2_0_ from db2.my_user user2x0_ where user2x0_.user_id=? for update
2008-07-02 22:14:42,656 DEBUG [main] (EntityLoader.java:79) - Static select for entity com.zhiku.vo.User2: select user2x0_.user_id as user1_2_0_, user2x0_.nuser_ame as nuser2_2_0_ from db2.my_user user2x0_ where user2x0_.user_id=? for update
2008-07-02 22:14:42,656 DEBUG [main] (EntityLoader.java:79) - Static select for entity com.zhiku.vo.User2: select user2x0_.user_id as user1_2_0_, user2x0_.nuser_ame as nuser2_2_0_ from db2.my_user user2x0_ where user2x0_.user_id=? for update
2008-07-02 22:14:42,656 DEBUG [main] (CascadeEntityLoader.java:34) - Static select for action ACTION_MERGE on entity com.zhiku.vo.User2: select user2x0_.user_id as user1_2_0_, user2x0_.nuser_ame as nuser2_2_0_ from db2.my_user user2x0_ where user2x0_.user_id=?
2008-07-02 22:14:42,656 DEBUG [main] (CascadeEntityLoader.java:34) - Static select for action ACTION_REFRESH on entity com.zhiku.vo.User2: select user2x0_.user_id as user1_2_0_, user2x0_.nuser_ame as nuser2_2_0_ from db2.my_user user2x0_ where user2x0_.user_id=?
2008-07-02 22:14:42,656 DEBUG [main] (SessionFactoryObjectFactory.java:76) - registered: 8a8a17cb1ae42004011ae4200ae00001 (unnamed)
2008-07-02 22:14:42,656  INFO [main] (SessionFactoryObjectFactory.java:82) - Not binding factory to JNDI, no JNDI name configured
2008-07-02 22:14:42,656 DEBUG [main] (SessionFactoryImpl.java:308) - instantiated session factory
2008-07-02 22:14:42,656 DEBUG [main] (SessionFactoryImpl.java:392) - Checking 0 named HQL queries
2008-07-02 22:14:42,656 DEBUG [main] (SessionFactoryImpl.java:412) - Checking 0 named SQL queries
2008-07-02 22:14:42,671 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'sessionFactory2'
2008-07-02 22:14:42,671 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'atomikosTransactionManager'
2008-07-02 22:14:42,671 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'atomikosTransactionManager'
2008-07-02 22:14:42,671 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'atomikosTransactionManager' to allow for resolving potential circular references
2008-07-02 22:14:42,671 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:1408) - Invoking init method  'init' on bean with name 'atomikosTransactionManager'
2008-07-02 22:14:43,875 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'atomikosTransactionManager'
2008-07-02 22:14:43,875 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'atomikosUserTransaction'
2008-07-02 22:14:43,875 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'atomikosUserTransaction'
2008-07-02 22:14:43,890 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'atomikosUserTransaction' to allow for resolving potential circular references
2008-07-02 22:14:43,890 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'atomikosUserTransaction'
2008-07-02 22:14:43,890 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'user1DAOImpl'
2008-07-02 22:14:43,890 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'user1DAOImpl'
2008-07-02 22:14:43,890 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'user1DAOImpl' to allow for resolving potential circular references
2008-07-02 22:14:43,890 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'sessionFactory1'
2008-07-02 22:14:43,906 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:1365) - Invoking afterPropertiesSet() on bean with name 'user1DAOImpl'
2008-07-02 22:14:43,906 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'user1DAOImpl'
2008-07-02 22:14:43,906 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'user2DAOImpl'
2008-07-02 22:14:43,906 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'user2DAOImpl'
2008-07-02 22:14:43,906 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'user2DAOImpl' to allow for resolving potential circular references
2008-07-02 22:14:43,906 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'sessionFactory2'
2008-07-02 22:14:43,906 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:1365) - Invoking afterPropertiesSet() on bean with name 'user2DAOImpl'
2008-07-02 22:14:43,906 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'user2DAOImpl'
2008-07-02 22:14:43,906 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'user1AndUser2ServiceImpl'
2008-07-02 22:14:43,906 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'user1AndUser2ServiceImpl'
2008-07-02 22:14:43,906 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'user1AndUser2ServiceImpl' to allow for resolving potential circular references
2008-07-02 22:14:43,906 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'user1DAOImpl'
2008-07-02 22:14:43,906 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'user2DAOImpl'
2008-07-02 22:14:43,921 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'user1AndUser2ServiceImpl'
2008-07-02 22:14:43,921 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'hibernateTransactionManager'
2008-07-02 22:14:43,921 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'hibernateTransactionManager'
2008-07-02 22:14:43,937 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'hibernateTransactionManager' to allow for resolving potential circular references
2008-07-02 22:14:43,937 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'atomikosTransactionManager'
2008-07-02 22:14:43,937 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'atomikosUserTransaction'
2008-07-02 22:14:43,937 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:1365) - Invoking afterPropertiesSet() on bean with name 'hibernateTransactionManager'
2008-07-02 22:14:43,937  INFO [main] (JtaTransactionManager.java:488) - Using JTA UserTransaction: com.atomikos.icatch.jta.UserTransactionImp@3b4b1e
2008-07-02 22:14:43,937  INFO [main] (JtaTransactionManager.java:499) - Using JTA TransactionManager: com.atomikos.icatch.jta.UserTransactionManager@c0a9f9
2008-07-02 22:14:43,937 DEBUG [main] (JtaTransactionManager.java:777) - JTA 1.1 [javax.transaction.TransactionSynchronizationRegistry] not available
2008-07-02 22:14:43,937 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'hibernateTransactionManager'
2008-07-02 22:14:43,937 DEBUG [main] (DefaultSingletonBeanRegistry.java:212) - Creating shared instance of singleton bean 'user1AndUser2ServiceProxy'
2008-07-02 22:14:43,937 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:383) - Creating instance of bean 'user1AndUser2ServiceProxy'
2008-07-02 22:14:43,953 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:457) - Eagerly caching bean 'user1AndUser2ServiceProxy' to allow for resolving potential circular references
2008-07-02 22:14:43,953 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'hibernateTransactionManager'
2008-07-02 22:14:43,968 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'user1AndUser2ServiceImpl'
2008-07-02 22:14:43,968 DEBUG [main] (NameMatchTransactionAttributeSource.java:108) - Adding transactional method [insert*] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]
2008-07-02 22:14:43,968 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:1365) - Invoking afterPropertiesSet() on bean with name 'user1AndUser2ServiceProxy'
2008-07-02 22:14:43,984 DEBUG [main] (JdkDynamicAopProxy.java:113) - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [com.zhiku.service.impl.User1AndUser2ServiceImpl@132021a]
2008-07-02 22:14:44,000 DEBUG [main] (AbstractAutowireCapableBeanFactory.java:411) - Finished creating instance of bean 'user1AndUser2ServiceProxy'
2008-07-02 22:14:44,000 DEBUG [main] (AbstractApplicationContext.java:273) - Publishing event in context [org.springframework.context.support.ClassPathXmlApplicationContext@b0f13d]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.ClassPathXmlApplicationContext@b0f13d: display name [org.springframework.context.support.ClassPathXmlApplicationContext@b0f13d]; startup date [Wed Jul 02 22:14:37 CST 2008]; root of context hierarchy]
2008-07-02 22:14:44,000 DEBUG [main] (AbstractBeanFactory.java:214) - Returning cached instance of singleton bean 'user1AndUser2ServiceProxy'
2008-07-02 22:14:44,015 DEBUG [main] (AbstractPlatformTransactionManager.java:346) - Using transaction object [org.springframework.transaction.jta.JtaTransactionObject@18f1be9]
2008-07-02 22:14:44,015 DEBUG [main] (AbstractPlatformTransactionManager.java:374) - Creating new transaction with name [com.zhiku.service.IUser1AndUser2Service.insertUser1AndUser2]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2008-07-02 22:14:44,078 DEBUG [main] (TransactionSynchronizationManager.java:228) - Initializing transaction synchronization
insertUser1AndUser2 方法开始执行
insert User1开始执行...
2008-07-02 22:14:44,109 DEBUG [main] (SessionFactoryUtils.java:318) - Opening Hibernate Session
2008-07-02 22:14:44,265 DEBUG [main] (SessionImpl.java:220) - opened session at timestamp: 12150080841
2008-07-02 22:14:44,265 DEBUG [main] (SessionFactoryUtils.java:326) - Registering Spring transaction synchronization for new Hibernate Session
2008-07-02 22:14:44,265 DEBUG [main] (TransactionSynchronizationManager.java:174) - Bound value [org.springframework.orm.hibernate3.SessionHolder@1de4dd8] for key [org.hibernate.impl.SessionFactoryImpl@9b1670] to thread [main]
2008-07-02 22:14:44,281 DEBUG [main] (TransactionSynchronizationManager.java:146) - Retrieved value [org.springframework.orm.hibernate3.SessionHolder@1de4dd8] for key [org.hibernate.impl.SessionFactoryImpl@9b1670] bound to thread [main]
2008-07-02 22:14:44,281 DEBUG [main] (HibernateTemplate.java:410) - Found thread-bound Session for HibernateTemplate
2008-07-02 22:14:44,281 DEBUG [main] (AbstractSaveEventListener.java:112) - generated identifier: 0, using strategy: org.hibernate.id.Assigned
2008-07-02 22:14:44,531 DEBUG [main] (HibernateTemplate.java:435) - Not closing pre-bound Hibernate Session after HibernateTemplate
insert User2开始执行...
2008-07-02 22:14:44,531 DEBUG [main] (SessionFactoryUtils.java:318) - Opening Hibernate Session
2008-07-02 22:14:44,531 DEBUG [main] (SessionImpl.java:220) - opened session at timestamp: 12150080845
2008-07-02 22:14:44,531 DEBUG [main] (SessionFactoryUtils.java:326) - Registering Spring transaction synchronization for new Hibernate Session
2008-07-02 22:14:44,531 DEBUG [main] (TransactionSynchronizationManager.java:174) - Bound value [org.springframework.orm.hibernate3.SessionHolder@1469658] for key [org.hibernate.impl.SessionFactoryImpl@159e6e8] to thread [main]
2008-07-02 22:14:44,531 DEBUG [main] (TransactionSynchronizationManager.java:146) - Retrieved value [org.springframework.orm.hibernate3.SessionHolder@1469658] for key [org.hibernate.impl.SessionFactoryImpl@159e6e8] bound to thread [main]
2008-07-02 22:14:44,531 DEBUG [main] (HibernateTemplate.java:410) - Found thread-bound Session for HibernateTemplate
2008-07-02 22:14:44,531 DEBUG [main] (AbstractSaveEventListener.java:112) - generated identifier: 2, using strategy: org.hibernate.id.Assigned
2008-07-02 22:14:44,531 DEBUG [main] (HibernateTemplate.java:435) - Not closing pre-bound Hibernate Session after HibernateTemplate
2008-07-02 22:14:44,531 DEBUG [main] (AbstractPlatformTransactionManager.java:880) - Triggering beforeCommit synchronization
2008-07-02 22:14:44,531 DEBUG [main] (SpringSessionSynchronization.java:134) - Flushing Hibernate Session on transaction synchronization
2008-07-02 22:14:44,531 DEBUG [main] (AbstractFlushingEventListener.java:111) - processing flush-time cascades
2008-07-02 22:14:44,546 DEBUG [main] (AbstractFlushingEventListener.java:154) - dirty checking collections
2008-07-02 22:14:44,546 DEBUG [main] (AbstractFlushingEventListener.java:85) - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
2008-07-02 22:14:44,546 DEBUG [main] (AbstractFlushingEventListener.java:91) - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2008-07-02 22:14:44,562 DEBUG [main] (Printer.java:83) - listing entities:
2008-07-02 22:14:44,562 DEBUG [main] (Printer.java:90) - com.zhiku.vo.User1{id=0, name=momoko}
2008-07-02 22:14:44,562 DEBUG [main] (AbstractBatcher.java:366) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2008-07-02 22:14:44,562 DEBUG [main] (ConnectionManager.java:421) - opening JDBC connection
2008-07-02 22:14:44,562 DEBUG [main] (AbstractBatcher.java:401) - insert into db1.my_user (user_name, user_id) values (?, ?)
2008-07-02 22:14:44,718 DEBUG [main] (BatchingBatcher.java:44) - Executing batch size: 1
2008-07-02 22:14:44,781 DEBUG [main] (AbstractBatcher.java:374) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2008-07-02 22:14:44,781 DEBUG [main] (AbstractPlatformTransactionManager.java:893) - Triggering beforeCompletion synchronization
2008-07-02 22:14:44,781 DEBUG [main] (TransactionSynchronizationManager.java:199) - Removed value [org.springframework.orm.hibernate3.SessionHolder@1de4dd8] for key [org.hibernate.impl.SessionFactoryImpl@9b1670] from thread [main]
2008-07-02 22:14:44,781 DEBUG [main] (TransactionSynchronizationManager.java:199) - Removed value [org.springframework.orm.hibernate3.SessionHolder@1469658] for key [org.hibernate.impl.SessionFactoryImpl@159e6e8] from thread [main]
2008-07-02 22:14:44,781 DEBUG [main] (AbstractPlatformTransactionManager.java:848) - Initiating transaction rollback after commit exception
java.lang.IllegalArgumentException: null source
at java.util.EventObject.<init>(Unknown Source)
at javax.sql.StatementEvent.<init>(Unknown Source)
at com.mysql.jdbc.jdbc2.optional.JDBC4PreparedStatementWrapper.close(JDBC4PreparedStatementWrapper.java:70)
at org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.closeStatement(AbstractBatcher.java:269)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:135)
at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:72)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:882)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:692)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy1.insertUser1AndUser2(Unknown Source)
at com.zhiku.struts.action.TestAction.main(TestAction.java:18)
Exception in thread "main" java.lang.IllegalArgumentException: null source
at java.util.EventObject.<init>(Unknown Source)
at javax.sql.StatementEvent.<init>(Unknown Source)
at com.mysql.jdbc.jdbc2.optional.JDBC4PreparedStatementWrapper.close(JDBC4PreparedStatementWrapper.java:70)
at org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.closeStatement(AbstractBatcher.java:269)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)2008-07-02 22:14:44,812 DEBUG [main] (AbstractPlatformTransactionManager.java:922) - Triggering afterCompletion synchronization
2008-07-02 22:14:44,812 DEBUG [main] (SessionFactoryUtils.java:774) - Closing Hibernate Session
2008-07-02 22:14:44,812 DEBUG [main] (ConnectionManager.java:441) - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2008-07-02 22:14:44,812 DEBUG [main] (ConnectionManager.java:302) - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
2008-07-02 22:14:44,828 DEBUG [main] (SessionFactoryUtils.java:774) - Closing Hibernate Session
2008-07-02 22:14:44,828 DEBUG [main] (TransactionSynchronizationManager.java:282) - Clearing transaction synchronization

at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:135)
at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:72)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:882)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:692)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy1.insertUser1AndUser2(Unknown Source)
at com.zhiku.struts.action.TestAction.main(TestAction.java:18)
4 楼 yangping19830524 2008-06-16  
你好 我按照你的方式去做了 但是总是没有实现 能联系我嘛 我的qq是 33732992
3 楼 zhengzhong 2008-05-20  
xa datasource transaction是为了满足业务逻辑
connectpool是为了提高DB操作效率
出发点不一样,不能放一起比较
2 楼 momoko8443 2008-05-15  
听不懂你在说什么。。。- -DB2从来没有接触过,不晓得。
频繁的操作查询 插入 连接可以有效的恢复到连接池里,这句话麻烦解释下。。。
1 楼 jayxu 2008-05-15  
atomikos确实还不错

不过3.2.3版本在对DB2支持不是很好,有问题,在官网的时候作者说在3.3中改进

虽然3.3还没在download list出现,但是可以猜出它的地址,我下来了

看到notes里说fix DB2的问题,而且重新设计了jdbc连接池

也看到新增加的的AtomikosDatasourceBean 但是好像用了还是有问题的

真烦

楼主你频繁的操作查询 插入 连接可以有效的恢复到连接池里吗?

相关推荐

    Spring+Jotm+Hibernate+Oracle+Junit 实现JTA分布式事务要求Demo工程

    2.Spring+Jotm整合实现JTA分布式事务,应用场景如转账等,同一事务内完成db1用户加100元、db2用户减100元。 3.Spring+Junit4单元测试,优点:不会破坏数据库现场,等等。 (特别注意:Spring3.0里不在提供对jotm的...

    spring+hibernate+jta demo

    2. **引入依赖**:添加Spring、Hibernate和JTA相关的jar包到项目的类路径中。通常还需要包含数据库驱动,如MySQL或Oracle驱动。 3. **配置Spring**:创建Spring的配置文件(如`applicationContext.xml`),配置Bean...

    JTA-demo:spring+hibernate+jta+mysql

    标题“JTA-demo:spring+hibernate+jta+mysql”揭示了一个集成示例,它展示了如何在Java应用中使用Spring框架、Hibernate ORM工具以及Java Transaction API(JTA)来管理事务,同时与MySQL数据库进行交互。...

    spring+hibernate+jtom demo

    在本文中,我们将深入探讨如何使用Spring、Hibernate和JOTM进行分布式事务管理,以实现在一个Service方法中同时操作两个不同数据源的数据,并确保任何错误都能导致所有操作回滚。首先,我们需要了解这些技术的基本...

    Spring+Hibernate+Struts2整合(包含Demo)

    在"Spring+Hibernate+Struts2整合(包含Demo)"的压缩包中,我们能看到一个完整的集成解决方案,这对于我们学习和实践这些技术非常有帮助。 首先,Spring框架作为核心的依赖注入(DI)和面向切面编程(AOP)框架,它...

    Eclipse下Spring+SpringMVC+Hibernate框架环境搭建demo

    本教程将详细介绍如何在Eclipse中搭建一个基于Spring、SpringMVC和Hibernate的集成开发环境,为初学者提供一个良好的起点。 首先,我们来了解这三个框架的核心功能: 1. **Spring**:这是一个轻量级的Java企业级...

    JTA_Demo:jta-in-spring

    【JTA_Demo:jta-in-spring】项目是一个典型的Java事务管理示例,它主要展示了如何在Spring框架中集成并使用Java Transaction API (JTA)进行分布式事务处理。在这个项目中,我们将会深入理解JTA的核心概念以及其在...

    HibernateDemo

    9. **性能优化**:Hibernate提供了第二级缓存和查询缓存,可以提高应用程序的性能。另外,还可以通过批处理操作、延迟加载等策略进一步优化。 10. **一对一、一对多、多对多关系映射**:Hibernate支持各种数据库...

    JBPM5入门学习.doc

    - **4.2.2 第二次运行时注释掉以下代码**: 为了避免不必要的错误,需要根据实际情况注释掉部分代码。 **4.3 移植WFproject** - **4.3.1 创建jbpm的web工程**: 在Eclipse中创建一个新的Web项目,并将其配置为支持...

    databasedemo

    Java EE提供了JTA(Java Transaction API)来管理分布式事务,而Spring框架提供了声明式事务管理,可以在配置文件中定义事务边界。 7. **数据库设计**:项目可能包含数据库模型设计,包括实体关系(ER)图、数据表...

    271个java需要用的jar包

    spring-hibernate3-2.0.8.jar spring-jdbc-3.1.1.RELEASE.jar spring-jdbc-4.1.4.RELEASE.jar spring-mock.jar spring-test-3.0.5.RELEASE.jar spring-tx-3.1.1.RELEASE.jar spring-web-3.0.5.RELEASE.jar spring-...

Global site tag (gtag.js) - Google Analytics