I have attempted to search thru the discussions on this but have not found anything
I am using netbeans6.0.1 for dev
Glassfish V2
Postgres 8.1.10
JPA at the EJB tier uses Hibernate EntityMananger 3.3.2 to wrk with the DB
I have a table Reminders (well it is suppose to keep track of reminders for a user). My app has a web tier, and ejb tier and db; web queries a user's reminders and shows it to him/her. User selects the reminders he/she wants to delete ... which then goes back to the ejb layer for deletion via EM/JPA
Querys of existing and Inserts for new reminders work perfectly ... When I attempt to delete the Reminders record it bombs ... with a stack trace; in the stack trace I dont see any causedby
Here is the code (the bolded line is where I am seeing the prblem ... well after the method returns and the tran get comitted)
I have put a break point and looked into the reminders object and all appears ok
Code:
@Stateless
public class RemindersFacade implements RemindersFacadeRemote {
@PersistenceContext
private EntityManager em;
public void create(Reminders reminders) {
em.persist(reminders);
}
public void edit(Reminders reminders) {
em.merge(reminders);
}
public void remove(Reminders reminders) {
[b] em.remove(em.merge(reminders));[/b]
}
public Reminders find(Object id) {
return em.find(com.repairtime.jpa.entities.generated.Reminders.class, id);
}
public List<Reminders> findAll() {
return em.createQuery("select object(o) from Reminders as o").getResultList();
}
}
Any help is appreaciated.
ps: I tried with Toplink that comes with the default NB, and that worked - I dont want to use Toplink however
===========================
Need help with Hibernate? Read this first: I have
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: hibernate-3.2.6.GA
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
EJB5018: An exception was thrown during an ejb invocation on [RemindersFacade]
javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
javax.transaction.RollbackException: Transaction marked for rollback.
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:440)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:371)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3792)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1354)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:210)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:117)
at $Proxy90.remove(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:233)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
at com.repairtime.ejb.session.generated.__RemindersFacadeRemote_Remote_DynamicStub.remove(com/repairtime/ejb/session/generated/__RemindersFacadeRemote_Remote_DynamicStub.java)
at com.repairtime.ejb.session.generated._RemindersFacadeRemote_Wrapper.remove(com/repairtime/ejb/session/generated/_RemindersFacadeRemote_Wrapper.java)
Name and version of the database you are using:
Postgre
8.1.10
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
No
Read this:
http://hibernate.org/42.html