我正在使用Java,Spring和Hibernate的項目。 我剛剛遇到這樣的情況。SQL連接問題
豆1:
<bean id="cat" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="proxyInterfaces">
<list>
<value>cat</value>
</list>
</property>
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributeSource">
<ref bean="attributeSource"/>
</property>
</bean>
豆2:
<bean id="dog" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="proxyInterfaces">
<list>
<value>dog</value>
</list>
</property>
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributeSource">
<ref bean="attributeSource"/>
</property>
</bean>
,但在執行收到以下異常
org.springframework.jdbc.support.SQLErrorCodesFactory] Error while extracting database product name - falling back to empty error codes
org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data;
nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection;
nested exception is java.sql.SQLException: Connection has already been created in this tx context for pool Illegal attempt to create connection from another pool
Caused by:
at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:613)
假設貓與狗是兩個不同的充接口
不能我們有兩個事務管理器打開?
答案中的鏈接域已死。 – Pang 2017-07-11 07:27:52