[Persistence, JBoss/CMP, Hibernate, Database] - Rollback not happening
by vphagura
I have a Stateless session bean on which a method is called from a servlet. The method in the Bean does a bunch of stuff and then when it want to access the Db it creates Dao objects by passing the EnitityManager which has been injected in this bean.
This Bean is supposed to write 4 different things to different tables in the single same operation, but fails on the last item and throws an exception. It turns out that it does not rollback the 3 it wrote.
My setting for the Hibernate peroperties in the persistence.properties file is:
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
| hibernate.connection.release_mode=after_statement
| hibernate.transaction.flush_before_completion=false
| hibernate.transaction.auto_close_session=false
| hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
| hibernate.hbm2ddl.auto=update
| #hibernate.hbm2ddl.auto=create-drop
| #hibernate.hbm2ddl.auto=create
| hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
| # Clustered cache with TreeCache
| #hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook
| #hibernate.treecache.mbean.object_name=jboss.cache:service=EJB3EntityTreeCache
| #hibernate.dialect=org.hibernate.dialect.HSQLDialect
| hibernate.connection.datasource=java:/TheranosDS
| hibernate.dialect=org.hibernate.dialect.MySQLDialect
| hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| hibernate.bytecode.use_reflection_optimizer=false
| # I don't think this is honored, but EJB3Deployer uses it
| hibernate.bytecode.provider=javassist
Moreover, the exception which is throws has the annotation:
@ApplicationException(rollback=true)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070272#4070272
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070272
18Â years, 8Â months
[EJB/JBoss] - Roll back not happening
by vphagura
I have a Stateless session bean on which a method is called from a servlet. The method in the Bean does a bunch of stuff and then when it want to access the Db it creates Dao objects by passing the EnitityManager which has been injected in this bean.
This Bean is supposed to write 4 different things to different tables in the single same operation, but fails on the last item and throws an exception. It turns out that it does not rollback the 3 it wrote.
My setting for the Hibernate peroperties in the persistence.properties file is:
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
| hibernate.connection.release_mode=after_statement
| hibernate.transaction.flush_before_completion=false
| hibernate.transaction.auto_close_session=false
| hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
| hibernate.hbm2ddl.auto=update
| #hibernate.hbm2ddl.auto=create-drop
| #hibernate.hbm2ddl.auto=create
| hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
| # Clustered cache with TreeCache
| #hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook
| #hibernate.treecache.mbean.object_name=jboss.cache:service=EJB3EntityTreeCache
| #hibernate.dialect=org.hibernate.dialect.HSQLDialect
| hibernate.connection.datasource=java:/TheranosDS
| hibernate.dialect=org.hibernate.dialect.MySQLDialect
| hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| hibernate.bytecode.use_reflection_optimizer=false
| # I don't think this is honored, but EJB3Deployer uses it
| hibernate.bytecode.provider=javassist
Moreover, the exception which is throws has the annotation:
@ApplicationException(rollback=true)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070269#4070269
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070269
18Â years, 8Â months
[JBoss Portal] - Re: Calling JAAS
by creative77
This is correct exactly as I have done it. Just a note I was not sure which authentication context to use. I used a different handler but the result is the same.
To those who need to know I used the JAAS context from the login-conf.xml file.
gersonjohan, this is part of the solution you are authenticating the username and password to JAAS. But, I don't think this is the complete registration. Once this is done you have to tell the portal that this user has authentication to access the pages and then redirect to the /auth context path. I am not sure what else needs to be called to get the user profile information registered along with security rights.
Another way of doing this in 2.6 would be to take the login.jsp and add it to the CMS. Then create a CMS portlet and add it to a page. I haven't tried this yet but it should word.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070268#4070268
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070268
18Â years, 8Â months