看到这 3 个文件,我得出的结论是:
1)这个应用程序使用 JPA 和 Hibernate 作为提供程序?!
2)连接池由tomcat(context.xml)控制?!
3) 交易情况如何?Seamframework 容器在这里控制事务吗?还是没有事务控制器!?
4)如果2)是真的,如果我想把那个连接池换成hibernate的C3PO,这个改变会有多大的影响?
((( components.xml )))
<persistence:entity-manager-factory name="entityManagerFactory" persistence-unit-name="sampleDatabase" />
<persistence:managed-persistence-context entity-manager-factory="#{entityManagerFactory}" name="entityManager" />
<factory auto-create="true" name="hibernateSession" value="#{entityManager.delegate}" />
<transaction:entity-transaction entity-manager="#{entityManager}" />
(((persistence.xml)))
<persistence-unit name="sampleDatabase">
<non-jta-data-source>java:comp/env/sampleDatasource</non-jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.jdbc.batch_size" value="20"/>
<property name="hibernate.connection.provider_class" value="com.sample.util.RoleProvider" />
</properties>
</persistence-unit>
(((上下文.xml)))
<Resource auth="Container"
name="sampleDatasource"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxActive="2"
maxIdle="1"
username="sample"
password="sample"
url="jdbc:oracle:thin:@myserver:1521:DESENV" />