[JBoss Seam] - Re: Problems setting up Seam-managed persistence context
by sgollery
Fernando,
In persistence.xml, I have
<jta-data-source>java:/myDatasource</jta-data-source>
In jboss-beans.xml, I have
| <bean name="myDatasourceBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
| <property name="driverClass">com.mysql.jdbc.Driver</property>
| ....other properties....
| <property name="transactionManager"><inject bean="TransactionManager"/></property>
| <property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property>
| <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
| </bean>
|
| <bean name="myDatasource" class="java.lang.Object">
| <constructor factoryMethod="getDatasource">
| <factory bean="myDatasourceBootstrap"/>
| </constructor>
| </bean>
|
Is that what you mean? Does it look right? The whole thing works if I use @PersistenceContext, so it seems like the setup must be reasonably correct.
Steve
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054862#4054862
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054862
18Â years, 10Â months
[JCA/JBoss] - Why is jboss closing my connection?
by teknokrat
I have written a JCA connection factory which works fine. I use it in a stateful session bean. On first use I always get
| 2007-06-15 18:39:42,746 TRACE [org.jboss.resource.connectionmanager.CachedConnectionManager] popped object: org.jboss.resource.connectionmanager.CachedConnectionManager$KeyConnectionAssociation@5522e1
| 2007-06-15 18:39:42,746 INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] Closing a connection for you. Please close them yourself: com.Connection@ec76fa
| java.lang.Throwable: STACKTRACE
| at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
|
|
Now my question is why? I have not called close on the connection for a reason - I want the bean to reuse it. What is going on here? I return the connection to the pool when I am done with it but jboss appears to try to pre-empt this. How do I fix this?
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054851#4054851
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054851
18Â years, 10Â months