[jboss-user] [JBoss Seam] - Re: EntityHome.persist fails with @GeneratedValue

asookazian do-not-reply at jboss.com
Thu Dec 20 18:27:02 EST 2007


JBOSS4.2.1.GA
SEAM2.0.0.GA

Same problem here (but w/o EntityHome design pattern).  I am seeing the following in the server.log before the exception.  Occurs with or w/o using the TransactionalSeamPhaseListener in faces-config.xml.  I am using SMPC with flushMode=MANUAL.  This could be a programmer's error but I don't know why it states "mark transaction for rollback" when the persist() method is called on the EntityManager.  There is no SQLException in the server.log.

SFSB:

  | for (int i = 0; i < 3; i++) {    		
  |     		TblSecurityAuditNote note = getTblSecurityAuditNote(currentRowNum, i);
  |     		if (note != null) {
  |     			log.info("myNotes["+currentRowNum+"]["+i+"]: noteId = " + note.getNoteId() + " noteText = " + note.getNoteText());    			
  |     			emICOMS.persist(note);
  |     		}
  |     	}
  |     	
  |     	emICOMS.flush();

stack trace:
2007-12-20 15:16:59,074 INFO  [com.cox.beans.interceptor.LoggerInterceptor] *** Entering method: submit
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 INFO  [com.cox.beans.session.SecurityAuditAction] myNotes[0][1]: noteId = null noteText = asdf
  | 2007-12-20 15:16:59,074 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] executing identity-insert immediately
  | 2007-12-20 15:16:59,074 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
  | 2007-12-20 15:16:59,074 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
  | 2007-12-20 15:16:59,074 DEBUG [org.hibernate.SQL] insert into boIcomsSecurityAudit.dbo.tblSecurityAuditNote (TimeStamp, NoteText, SITE_ID, EMPLOYEE_NUMBER, NoteType) values (?, ?, ?, ?, ?)
  | 2007-12-20 15:16:59,074 DEBUG [org.hibernate.id.IdentifierGeneratorFactory] Natively generated identity: 262
  | 2007-12-20 15:16:59,074 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
  | 2007-12-20 15:16:59,074 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
  | 2007-12-20 15:16:59,074 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 INFO  [com.cox.beans.session.SecurityAuditAction] myNotes[0][2]: noteId = 261 noteText = sdf
  | 2007-12-20 15:16:59,074 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] mark transaction for rollback
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 DEBUG [com.cox.beans.interceptor.ProfilingInterceptor] *** Method public void com.cox.beans.session.SecurityAuditAction.submit() executed in 0ms ***
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.interpolator
  | 2007-12-20 15:16:59,074 INFO  [com.cox.beans.session.SecurityAuditAction] in preDestroy
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preRemoveVariable.securityAuditAction
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postRemoveVariable.securityAuditAction
  | 2007-12-20 15:16:59,074 DEBUG [org.jboss.seam.ejb.RemoveInterceptor] Stateful component was removed: securityAuditAction
  | 2007-12-20 15:16:59,090 ERROR [STDERR] Dec 20, 2007 3:16:59 PM javax.faces.event.MethodExpressionActionListener processAction
  | SEVERE: Received 'javax.ejb.EJBTransactionRolledbackException' when invoking action listener '#{securityAuditAction.submit}' for component 'submitEmployee'
  | 2007-12-20 15:16:59,090 ERROR [STDERR] Dec 20, 2007 3:16:59 PM javax.faces.event.MethodExpressionActionListener processAction
  | SEVERE: javax.ejb.EJBTransactionRolledbackException: org.hibernate.PersistentObjectException: detached entity passed to persist: com.cox.beans.entity.TblSecurityAuditNote
  | 	at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114834#4114834

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114834



More information about the jboss-user mailing list