[Persistence, JBoss/CMP, Hibernate, Database] - Transaction timeout not detected ?
by davidbalazic
Hi!
We use jboss 4.0.4GA and the included hibernate.
We have configured JTA transactions and a XA datasource (oracle).
I noticed that it can happen that the transaction times out during a bean business method, but the call end without any error.
I discovered this during debugging, when the program executes a bit slower ;)
(due to stepping over the code)
What happens is this :
- method is entered and has a breakpoint
- I step over some hibernate stuff, like saving and updating some persisted objects
- right before the end , when all hibernate call are already stepped over, I wait a bit
- in the log this appears :
2007-05-25 14:38:00,015 WARN [org.jboss.tm.TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=my_pcs_name/58, BranchQual=, localId=58] timed out. status=STATUS_ACTIVE
- then I let jboss to run the method to end
What happens is that the client gets the methid finished without any error, as if everything were OK, but the data was not saved to the DB !
I am not a guru, but this look like a missed error.
Can some shed some light on the issue ?
This is the hibernate cfg file :
| <hibernate-configuration>
| <session-factory>
| <!-- database connection settings -->
| <property name="connection.datasource">
| java:/jdbc/foo/DataSource
| </property>
| <property name="connection.autocommit">false</property>
| <property name="transaction.auto_close_session">true</property>
| <property name="transaction.flush_before_completion">
| true
| </property>
| <property name="dialect">
| org.hibernate.dialect.Oracle9Dialect
| </property>
| <property name="show_sql">false</property>
| <property name="show_type">true</property>
|
| <!-- J2EE config -->
| <property name="current_session_context_class">jta</property>
| <property name="transaction.factory_class">
| org.hibernate.transaction.JTATransactionFactory
| </property>
| <property name="transaction.manager_lookup_class">
| org.hibernate.transaction.JBossTransactionManagerLookup
| </property>
| <property name="session_factory_name">
| jdbc/foo/HibernateSessionFactory
| </property>
|
|
| <!-- disable second-level-cache -->
| <property name="cache.use_second_level_cache">false</property>
| <property name="cache.provider_class">
| org.hibernate.cache.NoCacheProvider
| </property>
|
| <!-- some mappings here ... cut out to save space in the forum post ... -->
| </session-factory>
|
The datasource definition :
| <xa-datasource>
| <jndi-name>jdbc/foo/DataSource</jndi-name>
| <track-connection-by-tx />
| <isSameRM-override-value>false</isSameRM-override-value>
| <xa-datasource-class>
| oracle.jdbc.xa.client.OracleXADataSource
| </xa-datasource-class>
| <xa-datasource-property name="URL">
| jdbc:oracle:thin:@10.1..0:1521:FOO1
| </xa-datasource-property>
| <xa-datasource-property name="User">
| X_FOO
| </xa-datasource-property>
| <xa-datasource-property name="Password">
| bar
| </xa-datasource-property>
| <exception-sorter-class-name>
| org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
| </exception-sorter-class-name>
| <no-tx-separate-pools />
| <metadata>
| <type-mapping>Oracle9i</type-mapping>
| </metadata>
| <min-pool-size>1</min-pool-size>
| <max-pool-size>3</max-pool-size>
| <idle-timeout-minutes>0</idle-timeout-minutes>
| <check-valid-connection-sql>
| select 1 from dual
| </check-valid-connection-sql>
| </xa-datasource>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048690#4048690
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048690
18 years, 11 months
[JBossCache] - Re: EJB3 + JBossCache, accessing from external client
by bstansberry@jboss.com
Glad it's working. :)
As for the query cache, if you set it to true on the client side, then you are going to have to set up JBoss Cache as the second level cache on the client side.
I was briefly thinking maybe you could get away with using some other cache provider (ehcache, etc.) on the client side for your query caching, but the problem is if the client side case isn't a cluster-aware one that knows how to communicate with the server side cache you could get this:
1) Do a query on the client side that returns beans A, B, C. Cache the result.
2) Do something on the server side that changes B such that it would no longer match the query.
3) Do the query again on the client side. Client side query caching layer doesn't know about the change to B, so the out-of-date cached result of A, B, C is returned. Invalid.
Same problem applies in reverse as well.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048686#4048686
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048686
18 years, 11 months
[EJB 3.0] - JNDI Entry for EJB3 Session Bean in JBossAS 5.0.0Beta2 not a
by martinLuene
Deploying on JBossAS 5.0.0Beta2 succeeded, following one (correct) JNDI entry available:
jcoffee/components/jcoffee/UserManagement3: class $Proxy10
But the second JNDI Entry for Home Interface for EJB3 Session Bean (due to EJB2.1 Compatibility) is missing.
As subsequent fault, my EJB2.1 Session Bean can't find the EJB3 Session Bean.
Deploying on JBossAS 4.0.4GA with EJB3.0 package yields both JNDI Entries:
jcoffee/components/jcoffee/UserManagement3: $Proxy448
jcoffee/components/jcoffee/UserManagement3Home: class javax.naming.Reference
And my application works fine.
Is my lookup of the JNDI entry within my EJB2.1 bean wrong
or is there something broken in JBossAS 5.0.0Beta2?
Thanks,
Martin
Here the ejb-jar.xml with the tags for EJB2.1 compatibility:
| <?xml version='1.0' encoding='ISO-8859-1'?>
| <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
| http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
| version="3.0">
| <enterprise-beans>
| <session>
| <ejb-name>UserManagement3Component</ejb-name>
| <home>com.jcoffee.base.comp.server.ServiceProviderRemoteHome</home>
| <remote>com.jcoffee.base.comp.server.ServiceProviderRemote</remote>
| <local-home>com.jcoffee.base.comp.server.ServiceProviderLocalHome</local-home>
| <local>com.jcoffee.base.comp.server.ServiceProviderLocal</local>
| <ejb-class>com.jcoffee.components.um3.UserManagement3Component</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
| </session>
| </enterprise-beans>
| </ejb-jar>
|
Here the exception,
14:44:30,390 INFO [STDOUT] 2007-05-25 14:44:30,390 INFO exceptions.ServiceProviderNotFoundException - ServiceProviderNotFoundExc
eption The serviceprovider: 'Serviceprovider: (Home: jcoffee.UserManagement3)' could not be located!: Cannot lookup object 'jcoffe
e.components.jcoffee.UserManagement3Home'.: UserManagement3Home not bound called at com.jcoffee.base.server.EJBUtilities.createSer
viceProvider(EJBUtilities.java:209)
com.jcoffee.base.comp.global.exceptions.ServiceProviderNotFoundException: The serviceprovider: 'Serviceprovider: (Home: jcoffee.Us
erManagement3)' could not be located!;
---> nested com.jcoffee.base.global.JCoffeeNamingException: Cannot lookup object 'jcoffee.components.jcoffee.UserManagemen
t3Home'.;
---> nested javax.naming.NameNotFoundException: UserManagement3Home not bound
at com.jcoffee.base.server.EJBUtilities.createServiceProvider(EJBUtilities.java:209)
at com.jcoffee.base.comp.server.ServiceProvider.localExecute(ServiceProvider.java:633)
at com.jcoffee.base.comp.UserSessionBean.localExecute(UserSessionBean.java:452)
at com.jcoffee.base.comp.server.ServiceProvider.execute(ServiceProvider.java:375)
at sun.reflect.GeneratedMethodAccessor149.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:597)
at org.jboss.ejb.plugins.StatefulSessionSecurityInterceptor.invoke(StatefulSessionSecurityInterceptor.java:85)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:206)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:336)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)
at org.jboss.ejb.Container.invoke(Container.java:978)
at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:230)
at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:201)
at $Proxy10.invoke(Unknown Source)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:553)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:377)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:159)
Caused by: com.jcoffee.base.global.JCoffeeNamingException: Cannot lookup object 'jcoffee.components.jcoffee.UserManagement3Home'.;
---> nested javax.naming.NameNotFoundException: UserManagement3Home not bound
at com.jcoffee.base.global.naming.JNDIUtilities.lookup(JNDIUtilities.java:219)
at com.jcoffee.base.server.EJBUtilities.lookup(EJBUtilities.java:152)
at com.jcoffee.base.server.EJBUtilities.lookupServiceProvider(EJBUtilities.java:176)
at com.jcoffee.base.server.EJBUtilities.createServiceProvider(EJBUtilities.java:197)
... 43 more
Caused by: javax.naming.NameNotFoundException: UserManagement3Home not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:628)
at javax.naming.InitialContext.lookup(InitialContext.java:355)
at com.jcoffee.base.global.naming.JNDIUtilities.lookup(JNDIUtilities.java:217)
... 46 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048685#4048685
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048685
18 years, 11 months