1 Reply Latest reply on Dec 29, 2005 5:57 PM by gavin.king

    Beginner questions

    kryptontri

      Hi, I am morphing the booking example into a project.

      1) What is the timeline for a production release please ?

      2) For some examples, an @Table(name="xx") is not declared
      on entity beans e.g User , is there a reason why it would not
      be declared, for example, is it specified to override a default name such
      as the class name being the table name ?

      3) There are no errors in my logs, but i can't get my User example persisted
      even though its a staight copy of the booking example., here are the logs:

      2005-12-29 21:31:24,346 INFO [com.mycompany.cms.manager.Register] registering user
      2005-12-29 21:31:24,346 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] GETTING NEW EntityManager
      2005-12-29 21:31:24,346 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] logLivedSession.get() was NULL
      2005-12-29 21:31:24,346 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] LONG LIVED NOT FOUND
      2005-12-29 21:31:24,346 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4652613158281216
      2005-12-29 21:31:24,346 DEBUG [org.hibernate.impl.SessionImpl] find: select username from User where username=:username
      2005-12-29 21:31:24,346 DEBUG [org.hibernate.engine.QueryParameters] named parameters: {username=testuser5}
      2005-12-29 21:31:24,346 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] parse() - HQL: select username from com.mycompany.cms.model.User where username=:username
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.ast.AST] --- HQL AST ---
       \-[QUERY] 'query'
       +-[SELECT_FROM] 'SELECT_FROM'
       | +-[FROM] 'from'
       | | \-[RANGE] 'RANGE'
       | | \-[DOT] '.'
       | | +-[DOT] '.'
       | | | +-[DOT] '.'
       | | | | +-[DOT] '.'
       | | | | | +-[IDENT] 'com'
       | | | | | \-[IDENT] 'mycompany'
       | | | | \-[IDENT] 'cms'
       | | | \-[IDENT] 'model'
       | | \-[IDENT] 'User'
       | \-[SELECT] 'select'
       | \-[IDENT] 'username'
       \-[WHERE] 'where'
       \-[EQ] '='
       +-[IDENT] 'username'
       \-[COLON] ':'
       \-[IDENT] 'username'
      
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] select << begin [level=1, statement=select]
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.ast.tree.FromElement] FromClause{level=1} : com.mycompany.cms.model.User (no alias) -> user0_
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.ast.HqlSqlWalker] attempting to resolve property [username] as a non-qualified ref
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.ast.tree.FromReferenceNode] Resolved : {synthetic-alias} -> {synthetic-alias}
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.ast.tree.DotNode] getDataType() : username -> org.hibernate.type.StringType@aa2594
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.ast.tree.FromReferenceNode] Resolved : {synthetic-alias}.username -> user0_.username
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.ast.tree.FromReferenceNode] Resolved : username -> user0_.username
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] select : finishing up [level=1, statement=select]
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.ast.HqlSqlWalker] processQuery() : ( SELECT ( {select clause} ( user0_.username {synthetic-alias} username ) ) ( FromClause{level=1} TBL_USERS user0_ ) ( where ( = user0_.username ? ) ) )
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.ast.util.JoinProcessor] Using FROM fragment [TBL_USERS user0_]
      2005-12-29 21:31:24,356 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] select >> end [level=1, statement=select]
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.hql.ast.AST] --- SQL AST ---
       \-[SELECT] QueryNode: 'SELECT' querySpaces (TBL_USERS)
       +-[SELECT_CLAUSE] SelectClause: '{select clause}'
       | +-[DOT] DotNode: 'user0_.username' {propertyName=username,dereferenceType=4,propertyPath=username,path={synthetic-alias}.username,tableAlias=user0_,className=com.mycompany.cms.model.User,classAlias=null}
       | | +-[IDENT] IdentNode: '{synthetic-alias}' {originalText={synthetic-alias}}
       | | \-[IDENT] IdentNode: 'username' {originalText=username}
       | \-[SELECT_COLUMNS] SqlNode: ' as col_0_0_'
       +-[FROM] FromClause: 'from' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[user0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
       | \-[FROM_FRAGMENT] FromElement: 'TBL_USERS user0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=TBL_USERS,tableAlias=user0_,origin=null,colums={,className=com.mycompany.cms.model.User}}
       \-[WHERE] SqlNode: 'where'
       \-[EQ] BinaryLogicOperatorNode: '='
       +-[SQL_TOKEN] IdentNode: 'user0_.username' {originalText=username}
       \-[NAMED_PARAM] ParameterNode: '?'
      
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] HQL: select username from com.mycompany.cms.model.User where username=:username
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] SQL: select user0_.username as col_0_0_ from TBL_USERS user0_ where user0_.username=?
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.SQL] select user0_.username as col_0_0_ from TBL_USERS user0_ where user0_.username=?
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] preparing statement
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.loader.Loader] bindNamedParameters() testuser5 -> username [1]
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.type.StringType] binding 'testuser5' to parameter: 1
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open ResultSet (open ResultSets: 0, globally: 0)
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.loader.Loader] processing result set
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.loader.Loader] done processing result set (0 rows)
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close ResultSet (open ResultSets: 1, globally: 1)
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] closing statement
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.ConnectionManager] closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.engine.StatefulPersistenceContext] initializing non-lazy collections
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.engine.IdentifierValue] id unsaved-value strategy UNDEFINED
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] transient instance of: com.mycompany.cms.model.User
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.DefaultPersistEventListener] saving transient instance
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] generated identifier: testuser5, using strategy: org.hibernate.id.Assigned
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] saving [com.mycompany.cms.model.User#testuser5]
      2005-12-29 21:31:24,366 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** flushing.....
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] flushing session
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushing entities and processing referenced collections
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Processing unreferenced collections
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Scheduling collection removes/(re)creates/updates
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.pretty.Printer] listing entities:
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.pretty.Printer] com.mycompany.cms.model.User{password=triathlon, username=testuser5, name=testuser5}
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] executing flush
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] Inserting entity: [com.mycompany.cms.model.User#testuser5]
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.SQL] insert into TBL_USERS (name, password, username) values (?, ?, ?)
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] preparing statement
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] Dehydrating entity: [com.mycompany.cms.model.User#testuser5]
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.type.StringType] binding 'testuser5' to parameter: 1
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.type.StringType] binding 'triathlon' to parameter: 2
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.type.StringType] binding 'testuser5' to parameter: 3
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] Adding to batch
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] Executing batch size: 1
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.AbstractBatcher] closing statement
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.ConnectionManager] closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] post flush
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.transaction.CacheSynchronization] transaction before completion callback
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.JDBCContext] before transaction completion
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.impl.SessionImpl] before transaction completion
      2005-12-29 21:31:24,366 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** closing entity managersession **************
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.impl.SessionImpl] closing session
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.ConnectionManager] connection already null in cleanup : no action
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.transaction.CacheSynchronization] transaction after completion callback, status: 3
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.jdbc.JDBCContext] after transaction completion
      2005-12-29 21:31:24,366 DEBUG [org.hibernate.impl.SessionImpl] after transaction completion
      2005-12-29 21:31:24,376 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] Before render response
      2005-12-29 21:31:24,376 DEBUG [org.jboss.seam.core.Manager] Discarding conversation state: 9
      2005-12-29 21:31:24,386 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
      2005-12-29 21:31:24,386 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
      2005-12-29 21:31:24,386 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2005-12-29 21:31:24,416 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
      2005-12-29 21:31:24,416 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
      2005-12-29 21:31:24,416 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2005-12-29 21:31:24,416 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
      2005-12-29 21:31:24,416 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
      2005-12-29 21:31:24,416 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2005-12-29 21:31:24,426 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
      2005-12-29 21:31:24,426 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing busines process context
      2005-12-29 21:31:24,426 DEBUG [org.jboss.seam.contexts.BusinessProcessContext] no process instance to persist business process state
      2005-12-29 21:31:24,426 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
      2005-12-29 21:31:24,426 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
      2005-12-29 21:31:24,426 DEBUG [org.jboss.seam.contexts.Contexts] destroying: register
      2005-12-29 21:31:24,426 DEBUG [org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor] ++++ LongLivedSessionPropagationInterceptor
      2005-12-29 21:31:24,426 INFO [com.mycompany.cms.manager.Register] destroyed
      


      TIA anyone.

        • 1. Re: Beginner questions
          gavin.king

          1) Q1 2006

          2) Check the EJB3 spec. EJB3 features a lot of defaulting.

          3) I think you are mistaken. The log shows that the JDBC INSERT occurs, and that the JTA transaction is successfully committed (JTA status 3).