-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Kann nach merge den Datensatz nicht mehr löschen
PostPosted: Thu Jul 06, 2006 7:43 am 
Beginner
Beginner

Joined: Wed Jun 07, 2006 6:11 am
Posts: 20
Hibernate version: 3.2.0.cr2
Hibernate Annotations: 3.2.0.CR1
Hibernate Entity Manager: 3.2.0.CR1
EJB3 version: EJB-3.0 RC8-FD
JBoss version: 4.0.4.GA
Name and version of the database you are using: Ingres 3.0.105
Full stack trace of any exception that occurs:
Code:
13:22:20,140 WARN  [JDBCExceptionReporter] SQL Error: 4615, SQLState: 5000B
13:22:20,140 ERROR [JDBCExceptionReporter] An error occurred while deleting a record.
13:22:20,140 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not delete: [ams.uptoip.server.user.management.model.hibernate.rights.Login#224]
   at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2384)
   at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2516)
   at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:73)
   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144)
   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:993)
   at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:340)
   at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:475)
   at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
   at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
   at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
   at org.jboss.tm.TxManager.commit(TxManager.java:240)
   at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
   at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
   at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:227)
   at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
   at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
   at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
   at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
   at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
   at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412)
   at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
Caused by: ca.edbc.util.EdbcEx: An error occurred while deleting a record.
   at ca.edbc.jdbc.EdbcObj.readResults(EdbcObj.java:785)
   at ca.edbc.jdbc.EdbcObj.readResults(EdbcObj.java:576)
   at ca.edbc.jdbc.EdbcPrep.exec(EdbcPrep.java:795)
   at ca.edbc.jdbc.EdbcPrep.executeUpdate(EdbcPrep.java:466)
   at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
   at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
   at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2363)
   ... 36 more


Hi!
Wenn ich folgenden Code ausführe, kann ich den eingefügten und aktualisierten Datensatznicht mehr löschen (weder mit Hibernate, noch mit SQL direkt auf die DB).

Code:
protected @PersistenceContext(unitName = "XY_Manager", type = PersistenceContextType.TRANSACTION)
  EntityManager em;
 
// Insert Domain
Domain domain = em.find(Domain.class, id);
if (domain == null) {
  domain = new Domain();
  domain.setName(name);
  domain.setAddress(getAddress(domain.getAddress()));
  em.persist(domain);
  em.flush();
}

// Insert Login
Login login = new Login();
login.setName(name);
login.setPassword(password);
login.setDomain(domain);
login = em.merge(login);
em.flush();

// Remove works fine
//em.remove(loginHib); // OK

// Modify Login
login.setName("NEW NAME");

// Merge Login
login = em.merge(login);
em.flush();

// Remove does not work
em.remove(loginHib);  // ERROR


An was kann dies liegen? Bzw. ist mein Code richtig geschrieben?
Das Interessante ist ja, dass ich nach dem insert ein remove problemlos ausführen kann, jedoch nach dem merge nicht mehr ...

Danke!
Christian


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.