[jboss-user] [EJB/JBoss] - Re: do not auto commit after method is returned
ywtsang
do-not-reply at jboss.com
Sun Dec 21 09:07:55 EST 2008
persistence.xml:
| <persistence xmlns="http://java.sun.com/xml/ns/persistence"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
| version="1.0">
| <persistence-unit name="angelfish">
| <jta-data-source>java:/OracleDS</jta-data-source>
| <properties>
| <property name="hibernate.ejb.cfgfile" value="hibernate.cfg.xml"/>
| </properties>
| </persistence-unit>
| </persistence>
|
hibernate.cfg.xml:
| <hibernate-configuration>
| <session-factory>
| <property name="connection.datasource">java:/OracleDS</property>
| <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
| <property name="show_sql">true</property>
| <property name="format_sql">true</property>
| </session-factory>
| </hibernate-configuration>
|
class annotations of session bean
| @Clustered
| @Stateless
| @Interceptors(SpringLifecycleInterceptor.class)
| @Remote(XXX.class)
| @PermitAll
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| @TransactionManagement(TransactionManagementType.CONTAINER)
|
i have tried to add the @TransactionAttribute to the method, it also does not work
in fact, i also tried to implement SessionSynchronization
but for the all three callback methods
| afterBegin
| afterCompletion
| beforeCompletion
|
i have added debug print outs, it seems that the SessionSynchornization methods are not called
but i am quite sure a transaction should be opened, otherwise, i will receive complain from hibernate ,
the situation now is, no exception occurs in executing the session bean method, every thing looks fine except that the updated data is not committed/flushed to db, unless we call hibernate session's flush explicitly
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4197857#4197857
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4197857
More information about the jboss-user
mailing list