Hi,
I turned on
Hibernate 3.1 on
JBoss 4.0.5 using JMX manner, as mbean.
It works fine, I can notice it on JMX-Console.
Then I was going to use that database schema in EJB. I made simple session stateless bean, which serves some business method for data saving trough the Hibernate layer. The method signatured as transaction
Required, so please have look on piece of source:
Code:
/**
* An example business method
*
* @ejb.interface-method view-type = "remote"
* @ejb.transaction type = "Required"
*
* @throws EJBException Thrown if method fails due to system-level error.
*/
public void save(Message message) throws EJBException {
// rename and start putting your business logic here
Session se = hCx.getSession(SF_JNDI);
se.saveOrUpdate(message);
}
where hCx is actually HibernateContext as follow:
Code:
/** The session context */
private SessionContext cx;
private HibernateContext hCx;
Unfortunately, It doesn't work, the changes are not saved.
What's wrong?
Thanks for help
Krzysztof