Hi,

commit issued by hbm2ddl when updating database schema is fairly problematic. It failes when hbm2ddl is run in container managed bean.

I have a framework that fairly well converts project in ejb3 to ejb2.1. Problem arises with injection of EntityManager. I implement this injection by an aspect. This aspect is invoked every time the field annotated with @javax.persistence.PersistenceContext is read. If it is read for the first time inside a CMP bean then hbm2ddl is run (and I want to have it run) but fails because of the mentioned commit statement.

Is there a simple workaround (except for the obvious one - get the EntityManager inside a BMP bean for the first time)?
Is issuing commit realy necessary at all? I've thought that ddl commands don't run in a transaction.

Thanks for help,
Jan

PS: I'm sorry if this e-mail is inappropriate in this list but I've seen the same problem posted to the users list with no reply.

Reply via email to