Automatically rejected mail
by Mail Delivery Subsystem
Your message was automatically rejected by Dovecot Mail Delivery Agent.
The following reason was given:
Quota exceeded
17 years, 11 months
[EJB 3.0] - Bean Managed Transaction: No JTA transaction found
by rituraj_tiwari
I am resorting to BMT due to the need to launch persistence operations in worker threads.
I am using the BMT format as described here http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/transac...
So, I have
| @PersistenceUnit EntityManagerFactory m_emf;
| @Resource UserTransaction m_ut;
|
And my worker threads do the equivalent of
| public Result call() {
| EntityManager em = factory.createEntityManager();
| try {
|
| // do some work
| ...
|
| m_ut.commit();
| }
| catch (RuntimeException e) {
| if (m_ut != null) m_ut.rollback();
| throw e; // or display error message
| }
| finally {
| em.close();
| }
|
I observe that any entities I create aren't being written to the database. Looking in JBoss logs from the EntityManager creation point, I see:
| 2008-05-24 12:39:10,911 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
| 2008-05-24 12:39:10,911 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] No JTA transaction found
|
Also, When I look at what happens when I am creating and persisting entities, I see:
| 2008-05-24 12:40:05,036 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] delaying identity-insert due to no transaction in progress^M
|
Am I making some obvious mistake? Is launching persistent operations from separate threads not supported?
Thanks.
-Raj
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153175#4153175
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153175
17 years, 11 months
[EJB 3.0] - Transaction in injected EJB
by rituraj_tiwari
Folks,
I have a SLSB that launches tasks in a threadpool. The task threads need to access entities and persist them.
I am accessing this SLSB by injecting it into another SLSB (which is also a seam component).
My problems are :
1. The moment my threads try to persist anything using the injected EntityManager (org.jboss.ejb3.entity.TransactionScopedEntityManager), it throws an exception saying that a transaction needs to be started
2. If I try to fix the above problem by em.getTransaction().begin(), I get an IllegalStateException saying I cannot do that in a managed and injected entity manager.
Is JBoss really conspiring to keep me from getting my project done :-) ?
Any help will greatly help my sanity.
-Raj
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153170#4153170
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153170
17 years, 11 months