-->
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.  [ 8 posts ] 
Author Message
 Post subject: could not get next sequence value
PostPosted: Wed Mar 12, 2008 5:11 am 
Newbie

Joined: Wed Mar 12, 2008 4:31 am
Posts: 1
Hi, When I try an example on hibenate, I get the following error!
Quote:
16:42:09,328 ERROR JDBCExceptionReporter:78 - ORA-02289: sequence does not exist

org.hibernate.exception.SQLGrammarException: could not get next sequence value
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:96)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:495)
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:585)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
at $Proxy0.saveOrUpdate(Unknown Source)
at de.laliluna.example.TestExample.createHoney(TestExample.java:86)
at de.laliluna.example.TestExample.main(TestExample.java:31)
Caused by: java.sql.SQLException: ORA-02289: sequence does not exist

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:880)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2516)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2850)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:537)
at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:75)
... 16 more



All my files are as below:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="de.laliluna.example">
    <class name="Honey" table="STUDENT" >
       
      <!--
        <id name="studentid" column="studentid">
            <generator class="sequence"> 
                <param name="sequence" >honey_id_seq</param>
            </generator>
        </id>
        -->
        <id name="studentid"  column="studentid" >
            <generator class="sequence">
        <param name="sequence" >honey_id_seq</param>
      </generator>
        </id>
       
       
        <property name="name" type="string"></property>
        <property name="course" type="string"></property>
    </class>
   
</hibernate-mapping>

Code:
/**
* Example class
* @author Sebastian Hennebrueder
* created Jan 16, 2006
* copyright 2006 by http://www.laliluna.de
*/
package de.laliluna.example;

public class Honey {

   private int studentid;

   private String name;

   private String course;

   public Honey() {

   }

   public int getStudentid() {
      return studentid;
   }

   public void setStudentid(int Studentid) {
      this.studentid = studentid;
   }

   public String getName() {
      return name;
   }

   public void setName(String name) {
      this.name = name;
   }

   public String getCourse() {
      return course;
   }

   public void setCourse(String course) {
      this.course = course;
   }
       
   @Override
   public String toString() {
      return "Honey: "+getStudentid()+" Name: "+getName()+" course: "+getCourse();
   }
   
   
}

Code:
/**
* Test application for example
* @author Sebastian Hennebrueder
* created Jan 16, 2006
* copyright 2006 by http://www.laliluna.de
*/

package de.laliluna.example;

import java.util.Iterator;
import java.util.List;

import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;

import de.laliluna.hibernate.InitSessionFactory;

public class TestExample {

   private static Logger log =Logger.getLogger(TestExample.class);
   /**
    * @param args
    */
   public static void main(String[] args) {
      Honey forestHoney = new Honey();
                //forestHoney.setStudentid(100);
      forestHoney.setName("Helen");
      forestHoney.setCourse("Biology");
                createHoney(forestHoney);
                //listHoney();
      //Honey countryHoney = new Honey();
                //countryHoney.setStudentid(200);
      //countryHoney.setName("John");
      //countryHoney.setCourse("Astrology");      
      //createHoney(countryHoney);
      // our instances have a primary key now:
      log.debug(forestHoney);
      //log.debug(countryHoney);
      //listHoney();
      //deleteHoney(forestHoney);
      //listHoney();

   }

   private static void listHoney() {
      Transaction tx = null;
      Session session = InitSessionFactory.getInstance().getCurrentSession();
      try {
         tx = session.beginTransaction();
         List honeys = session.createQuery("select h from Honey as h")
               .list();
         for (Iterator iter = honeys.iterator(); iter.hasNext();) {
            Honey element = (Honey) iter.next();
            log.debug(element);
         }
         tx.commit();
      } catch (HibernateException e) {
         e.printStackTrace();
         if (tx != null && tx.isActive())
            tx.rollback();

      }
   }

   private static void deleteHoney(Honey honey) {
      Transaction tx = null;
      Session session = InitSessionFactory.getInstance().getCurrentSession();
      try {
         tx = session.beginTransaction();
         session.delete(honey);
         tx.commit();
      } catch (HibernateException e) {
         e.printStackTrace();
         if (tx != null && tx.isActive())
            tx.rollback();
      }
   }

   private static void createHoney(Honey honey) {
      Transaction tx = null;
      Session session = InitSessionFactory.getInstance().getCurrentSession();
      try {
         tx = session.beginTransaction();
         session.saveOrUpdate(honey);
         tx.commit();
                        //session.close();
                       
      } catch (HibernateException e) {
         e.printStackTrace();
         if (tx != null && tx.isActive())
            tx.rollback();
      }
   }
}

Code:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>

  <session-factory>
    <!--  PostgreSQL connection -->
    <property name="connection.url">jdbc:oracle:thin:@XYZ:1522:db</property>
    <property name="connection.username">USERNAME</property>
    <property name="connection.password">PASSWORD</property>
    <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    <property name="dialect"> org.hibernate.dialect.Oracle10gDialect</property>
    <property name="connection.autocommit">true</property>


        <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
    <!--  thread is the short name for
      org.hibernate.context.ThreadLocalSessionContext
      and let Hibernate bind the session automatically to the thread
    -->
    <property name="current_session_context_class">thread</property>
    <!-- this will show us all sql statements -->
    <property name="hibernate.show_sql">true</property>
    <!-- this will create the database tables for us -->
    <property name="hibernate.hbm2ddl.auto">update</property>
    <mapping resource="de/laliluna/example/Honey.hbm.xml" />

  </session-factory>

</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 5:18 am 
Newbie

Joined: Wed Mar 12, 2008 5:14 am
Posts: 1
Got the same stuff dude, well almost the same. gotta smth to do :)

_________________
http://www.mybestcity.com
http://www.newbabyassistant.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 28, 2008 8:11 am 
Newbie

Joined: Mon Jul 28, 2008 7:34 am
Posts: 4
I got the same problem:

Annotation:
Code:
@Id
    @Column(name = "id", unique = true, nullable = false)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GEN")
    @SequenceGenerator(name = "SEQ_GEN", sequenceName = "OnlyTest_id_seq", allocationSize = 10)



Table:
Code:
CREATE TABLE "OnlyTest"
(
  id serial NOT NULL,
  "name" character varying(80) NOT NULL,
  CONSTRAINT "OnlyTest_pkey" PRIMARY KEY (id)
)


Sequence:
Code:
CREATE SEQUENCE "OnlyTest_id_seq"
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;


Test Code:
Code:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("er1PU");
        EntityManager em = emf.createEntityManager(); // Retrieve an application managed entity manager
        OnlyTest e = new OnlyTest();
        e.setName("aa");
        em.persist(e);
        em.close();
        emf.close();



And Log:
Code:
15:43:14,609  INFO Version:15 - Hibernate Annotations 3.3.1.GA
15:43:14,640  INFO Environment:514 - Hibernate 3.2.6
15:43:14,640  INFO Environment:547 - hibernate.properties not found
15:43:14,656  INFO Environment:681 - Bytecode provider name : cglib
15:43:14,656  INFO Environment:598 - using JDK 1.4 java.sql.Timestamp handling
15:43:14,734  INFO Version:15 - Hibernate EntityManager 3.3.2.GA
15:43:14,765 DEBUG Ejb3Configuration:209 - Look up for persistence unit: er1PU
15:43:14,781 DEBUG Ejb3Configuration:221 - Analysing persistence.xml: file:/E:/entityPrjojectNetbeans/projects/er1/build/classes/META-INF/persistence.xml
15:43:15,296 DEBUG PersistenceXmlLoader:156 - Persistent Unit name from persistence.xml: er1PU
15:43:15,296 DEBUG Ejb3Configuration:228 - PersistenceMetadata [
        name: er1PU
        jtaDataSource: null
        nonJtaDataSource: null
        transactionType: RESOURCE_LOCAL
        provider: org.hibernate.ejb.HibernatePersistence
        classes[
                er1.Attributes                er1.Entities                er1.OnlyTest        ]
        packages[
        ]
        mappingFiles[
        ]
        jarFiles[
        ]
        hbmfiles: 0
        properties[
                hibernate.connection.username: postgres
                hibernate.connection.password: 12345
                hibernate.cache.provider_class: org.hibernate.cache.NoCacheProvider
                hibernate.connection.url: jdbc:postgresql://localhost:5432/domains
                hibernate.connection.driver_class: org.postgresql.Driver
        ]]
15:43:15,312 DEBUG JarVisitorFactory:73 - JAR URL from URL Entry: file:/E:/entityPrjojectNetbeans/projects/er1/build/classes/META-INF/persistence.xml >> file:/E:/entityPrjojectNetbeans/projects/er1/build/classes/
15:43:15,312 DEBUG Ejb3Configuration:562 - Detect class: true; detect hbm: true
15:43:15,343 DEBUG AbstractJarVisitor:116 - Searching mapped entities in jar/par: file:/E:/entityPrjojectNetbeans/projects/er1/build/classes/
15:43:15,343 DEBUG AbstractJarVisitor:162 - Filtering: er1.Attributes
15:43:15,421 DEBUG AbstractJarVisitor:213 - Java element filter matched for er1.Attributes
15:43:15,421 DEBUG AbstractJarVisitor:162 - Filtering: er1.Entities
15:43:15,437 DEBUG AbstractJarVisitor:213 - Java element filter matched for er1.Entities
15:43:15,437 DEBUG AbstractJarVisitor:162 - Filtering: er1.Main
15:43:15,437 DEBUG AbstractJarVisitor:162 - Filtering: er1.OnlyTest
15:43:15,437 DEBUG AbstractJarVisitor:213 - Java element filter matched for er1.OnlyTest
15:43:15,437 DEBUG Ejb3Configuration:562 - Detect class: true; detect hbm: true
15:43:15,437 DEBUG Ejb3Configuration:158 - Creating Factory: er1PU
15:43:15,562  INFO AnnotationBinder:418 - Binding entity from annotated class: er1.Attributes
15:43:15,578  INFO QueryBinder:64 - Binding Named query: Attributes.findAll => SELECT a FROM Attributes a
15:43:15,578  INFO QueryBinder:64 - Binding Named query: Attributes.findById => SELECT a FROM Attributes a WHERE a.id = :id
15:43:15,578  INFO QueryBinder:64 - Binding Named query: Attributes.findByFarname => SELECT a FROM Attributes a WHERE a.farname = :farname
15:43:15,640  INFO EntityBinder:424 - Bind entity er1.Attributes on table attributes
15:43:15,718  INFO AnnotationBinder:418 - Binding entity from annotated class: er1.Entities
15:43:15,718  INFO QueryBinder:64 - Binding Named query: Entities.findAll => SELECT e FROM Entities e
15:43:15,718  INFO QueryBinder:64 - Binding Named query: Entities.findById => SELECT e FROM Entities e WHERE e.id = :id
15:43:15,718  INFO QueryBinder:64 - Binding Named query: Entities.findByFarname => SELECT e FROM Entities e WHERE e.farname = :farname
15:43:15,718  INFO QueryBinder:64 - Binding Named query: Entities.findByEngname => SELECT e FROM Entities e WHERE e.engname = :engname
15:43:15,718  INFO QueryBinder:64 - Binding Named query: Entities.findByComment => SELECT e FROM Entities e WHERE e.comment = :comment
15:43:15,718  INFO EntityBinder:424 - Bind entity er1.Entities on table entities
15:43:15,781  INFO AnnotationBinder:418 - Binding entity from annotated class: er1.OnlyTest
15:43:15,781  INFO QueryBinder:64 - Binding Named query: OnlyTest.findAll => SELECT o FROM OnlyTest o
15:43:15,781  INFO QueryBinder:64 - Binding Named query: OnlyTest.findById => SELECT o FROM OnlyTest o WHERE o.id = :id
15:43:15,781  INFO QueryBinder:64 - Binding Named query: OnlyTest.findByName => SELECT o FROM OnlyTest o WHERE o.name = :name
15:43:15,781  INFO EntityBinder:424 - Bind entity er1.OnlyTest on table OnlyTest
15:43:15,859  INFO CollectionBinder:651 - Mapping collection: er1.Entities.attributesCollection -> attributes
15:43:15,875  INFO AnnotationConfiguration:365 - Hibernate Validator not found: ignoring
15:43:15,906 DEBUG NamingHelper:30 - No JNDI name configured for binding Ejb3Configuration
15:43:15,922  INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
15:43:15,922  INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
15:43:15,922  INFO DriverManagerConnectionProvider:45 - autocommit mode: true
15:43:15,937  INFO DriverManagerConnectionProvider:80 - using driver: org.postgresql.Driver at URL: jdbc:postgresql://localhost:5432/domains
15:43:15,937  INFO DriverManagerConnectionProvider:86 - connection properties: {user=postgres, password=****, autocommit=true, release_mode=auto}
15:43:16,125  INFO SettingsFactory:89 - RDBMS: PostgreSQL, version: 8.3.3
15:43:16,125  INFO SettingsFactory:90 - JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC3 with SSL (build 603)
15:43:16,156  INFO Dialect:152 - Using dialect: org.hibernate.dialect.PostgreSQLDialect
15:43:16,156  INFO TransactionFactoryFactory:34 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
15:43:16,172  INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
15:43:16,172  INFO SettingsFactory:143 - Automatic flush during beforeCompletion(): disabled
15:43:16,172  INFO SettingsFactory:147 - Automatic session close at end of transaction: disabled
15:43:16,172  INFO SettingsFactory:154 - JDBC batch size: 15
15:43:16,172  INFO SettingsFactory:157 - JDBC batch updates for versioned data: disabled
15:43:16,172  INFO SettingsFactory:162 - Scrollable result sets: enabled
15:43:16,172  INFO SettingsFactory:170 - JDBC3 getGeneratedKeys(): disabled
15:43:16,187  INFO SettingsFactory:178 - Connection release mode: auto
15:43:16,187  INFO SettingsFactory:205 - Default batch fetch size: 1
15:43:16,187  INFO SettingsFactory:209 - Generate SQL with comments: disabled
15:43:16,187  INFO SettingsFactory:213 - Order SQL updates by primary key: disabled
15:43:16,187  INFO SettingsFactory:217 - Order SQL inserts for batching: disabled
15:43:16,203  INFO SettingsFactory:386 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
15:43:16,203  INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
15:43:16,203  INFO SettingsFactory:225 - Query language substitutions: {}
15:43:16,203  INFO SettingsFactory:230 - JPA-QL strict compliance: enabled
15:43:16,203  INFO SettingsFactory:235 - Second-level cache: enabled
15:43:16,203  INFO SettingsFactory:239 - Query cache: disabled
15:43:16,219  INFO SettingsFactory:373 - Cache provider: org.hibernate.cache.NoCacheProvider
15:43:16,219  INFO SettingsFactory:254 - Optimize cache for minimal puts: disabled
15:43:16,219  INFO SettingsFactory:263 - Structured second-level cache entries: disabled
15:43:16,234  INFO SettingsFactory:290 - Statistics: disabled
15:43:16,234  INFO SettingsFactory:294 - Deleted entity synthetic identifier rollback: disabled
15:43:16,234  INFO SettingsFactory:309 - Default entity-mode: pojo
15:43:16,234  INFO SettingsFactory:313 - Named query checking : enabled
15:43:16,266  INFO SessionFactoryImpl:161 - building session factory
15:43:16,641  INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
15:43:16,953 DEBUG SQL:401 - select nextval ('OnlyTest_id_seq')
15:43:16,985  WARN JDBCExceptionReporter:77 - SQL Error: 0, SQLState: 42P01
15:43:16,985 ERROR JDBCExceptionReporter:78 - ERROR: relation "onlytest_id_seq" does not exist
15:43:16,985 DEBUG AbstractEntityManagerImpl:425 - mark transaction for rollback
Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get next sequence value
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
        at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)
        at er1.Main.main(Main.java:29)
Caused by: org.hibernate.exception.SQLGrammarException: could not get next sequence value
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:96)
        at org.hibernate.id.SequenceHiLoGenerator.generate(SequenceHiLoGenerator.java:58)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
        at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
        at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
        at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
        at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
        at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
        at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
        at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
        at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)
        ... 1 more
Caused by: org.postgresql.util.PSQLException: ERROR: relation "onlytest_id_seq" does not exist
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
        at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:75)
        ... 11 more
Java Result: 1




Any suggestion?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 28, 2008 8:31 am 
Newbie

Joined: Sun Apr 27, 2008 3:30 pm
Posts: 7
In Postgresql I have problems if I explicitly specify mix case of names in tables and sequences. At some point the query in hibernate is being resolved to lower case and not matching.

so Create your sequence without the quotes round the name.

CREATE SEQUENCE onlytest_id_seq (
... )

and table

CREATE TABLE onlytest (
... )


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 28, 2008 11:52 am 
Newbie

Joined: Mon Jul 28, 2008 7:34 am
Posts: 4
Thanks Milesy

I will check it.


Last edited by skyx on Mon Jul 28, 2008 11:55 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 28, 2008 11:53 am 
Newbie

Joined: Mon Jul 28, 2008 7:34 am
Posts: 4
I created a table and sequence that their names is in lower case.
Code run without any error now. But actually nothing happen in database.
When I check my TABLE new row didn't insert into it.

Any idea?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 28, 2008 12:11 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
skyx,

Are you getting any errors? Are you catching all RuntimeExceptions and logging them?

If nothing is going in, there should be something in the logs.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 28, 2008 1:37 pm 
Newbie

Joined: Mon Jul 28, 2008 7:34 am
Posts: 4
Ok, this is log:

Code:
19:41:56,902  INFO Version:15 - Hibernate Annotations 3.3.1.GA
19:41:56,949  INFO Environment:514 - Hibernate 3.2.6
19:41:56,965  INFO Environment:547 - hibernate.properties not found
19:41:56,965  INFO Environment:681 - Bytecode provider name : cglib
19:41:56,980  INFO Environment:598 - using JDK 1.4 java.sql.Timestamp handling
19:41:57,074  INFO Version:15 - Hibernate EntityManager 3.3.2.GA
19:41:57,105 DEBUG Ejb3Configuration:209 - Look up for persistence unit: er5PU
19:41:57,105 DEBUG Ejb3Configuration:221 - Analysing persistence.xml: file:/F:/EntityProjectJava/projects/er5/build/classes/META-INF/persistence.xml
19:41:57,402 DEBUG PersistenceXmlLoader:156 - Persistent Unit name from persistence.xml: er5PU
19:41:57,402 DEBUG Ejb3Configuration:228 - PersistenceMetadata [
        name: er5PU
        jtaDataSource: null
        nonJtaDataSource: null
        transactionType: RESOURCE_LOCAL
        provider: org.hibernate.ejb.HibernatePersistence
        classes[
                er5.Entities                er5.Attributes                er5.Books        ]
        packages[
        ]
        mappingFiles[
        ]
        jarFiles[
        ]
        hbmfiles: 0
        properties[
                hibernate.connection.username: postgres
                hibernate.connection.password: 12345
                hibernate.cache.provider_class: org.hibernate.cache.NoCacheProvider
                hibernate.show_sql: true
                hibernate.connection.url: jdbc:postgresql://localhost:5432/er
                hibernate.connection.driver_class: org.postgresql.Driver
        ]]
19:41:57,433 DEBUG JarVisitorFactory:73 - JAR URL from URL Entry: file:/F:/EntityProjectJava/projects/er5/build/classes/META-INF/persistence.xml >> file:/F:/EntityProjectJava/projects/er5/build/classes/
19:41:57,433 DEBUG Ejb3Configuration:562 - Detect class: true; detect hbm: true
19:41:57,449 DEBUG AbstractJarVisitor:116 - Searching mapped entities in jar/par: file:/F:/EntityProjectJava/projects/er5/build/classes/
19:41:57,449 DEBUG AbstractJarVisitor:162 - Filtering: er5.Attributes
19:41:57,511 DEBUG AbstractJarVisitor:213 - Java element filter matched for er5.Attributes
19:41:57,527 DEBUG AbstractJarVisitor:162 - Filtering: er5.Books
19:41:57,527 DEBUG AbstractJarVisitor:213 - Java element filter matched for er5.Books
19:41:57,527 DEBUG AbstractJarVisitor:162 - Filtering: er5.Entities
19:41:57,527 DEBUG AbstractJarVisitor:213 - Java element filter matched for er5.Entities
19:41:57,527 DEBUG AbstractJarVisitor:162 - Filtering: er5.Main
19:41:57,527 DEBUG Ejb3Configuration:562 - Detect class: true; detect hbm: true
19:41:57,527 DEBUG Ejb3Configuration:158 - Creating Factory: er5PU
19:41:57,652  INFO AnnotationBinder:418 - Binding entity from annotated class: er5.Entities
19:41:57,668  INFO QueryBinder:64 - Binding Named query: Entities.findAll => SELECT e FROM Entities e
19:41:57,668  INFO QueryBinder:64 - Binding Named query: Entities.findById => SELECT e FROM Entities e WHERE e.id = :id
19:41:57,668  INFO QueryBinder:64 - Binding Named query: Entities.findByFarname => SELECT e FROM Entities e WHERE e.farname = :farname
19:41:57,683  INFO QueryBinder:64 - Binding Named query: Entities.findByEngname => SELECT e FROM Entities e WHERE e.engname = :engname
19:41:57,715  INFO EntityBinder:424 - Bind entity er5.Entities on table entities
19:41:57,840  INFO AnnotationBinder:418 - Binding entity from annotated class: er5.Attributes
19:41:57,840  INFO QueryBinder:64 - Binding Named query: Attributes.findAll => SELECT a FROM Attributes a
19:41:57,840  INFO QueryBinder:64 - Binding Named query: Attributes.findById => SELECT a FROM Attributes a WHERE a.id = :id
19:41:57,840  INFO QueryBinder:64 - Binding Named query: Attributes.findByFarname => SELECT a FROM Attributes a WHERE a.farname = :farname
19:41:57,840  INFO QueryBinder:64 - Binding Named query: Attributes.findByType => SELECT a FROM Attributes a WHERE a.type = :type
19:41:57,840  INFO EntityBinder:424 - Bind entity er5.Attributes on table attributes
19:41:57,886  INFO AnnotationBinder:418 - Binding entity from annotated class: er5.Books
19:41:57,886  INFO QueryBinder:64 - Binding Named query: Books.findAll => SELECT b FROM Books b
19:41:57,886  INFO QueryBinder:64 - Binding Named query: Books.findById => SELECT b FROM Books b WHERE b.id = :id
19:41:57,886  INFO QueryBinder:64 - Binding Named query: Books.findByName => SELECT b FROM Books b WHERE b.name = :name
19:41:57,886  INFO EntityBinder:424 - Bind entity er5.Books on table books
19:41:57,996  INFO CollectionBinder:651 - Mapping collection: er5.Entities.attributesCollection -> attributes
19:41:57,996  INFO AnnotationConfiguration:365 - Hibernate Validator not found: ignoring
19:41:58,027 DEBUG NamingHelper:30 - No JNDI name configured for binding Ejb3Configuration
19:41:58,043  INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
19:41:58,043  INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
19:41:58,043  INFO DriverManagerConnectionProvider:45 - autocommit mode: true
19:41:58,074  INFO DriverManagerConnectionProvider:80 - using driver: org.postgresql.Driver at URL: jdbc:postgresql://localhost:5432/er
19:41:58,074  INFO DriverManagerConnectionProvider:86 - connection properties: {user=postgres, password=****, autocommit=true, release_mode=auto}
19:41:58,496  INFO SettingsFactory:89 - RDBMS: PostgreSQL, version: 8.3.3
19:41:58,496  INFO SettingsFactory:90 - JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC3 with SSL (build 603)
19:41:58,574  INFO Dialect:152 - Using dialect: org.hibernate.dialect.PostgreSQLDialect
19:41:58,590  INFO TransactionFactoryFactory:34 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
19:41:58,590  INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
19:41:58,590  INFO SettingsFactory:143 - Automatic flush during beforeCompletion(): disabled
19:41:58,590  INFO SettingsFactory:147 - Automatic session close at end of transaction: disabled
19:41:58,590  INFO SettingsFactory:154 - JDBC batch size: 15
19:41:58,590  INFO SettingsFactory:157 - JDBC batch updates for versioned data: disabled
19:41:58,605  INFO SettingsFactory:162 - Scrollable result sets: enabled
19:41:58,605  INFO SettingsFactory:170 - JDBC3 getGeneratedKeys(): disabled
19:41:58,605  INFO SettingsFactory:178 - Connection release mode: auto
19:41:58,605  INFO SettingsFactory:205 - Default batch fetch size: 1
19:41:58,605  INFO SettingsFactory:209 - Generate SQL with comments: disabled
19:41:58,605  INFO SettingsFactory:213 - Order SQL updates by primary key: disabled
19:41:58,605  INFO SettingsFactory:217 - Order SQL inserts for batching: disabled
19:41:58,605  INFO SettingsFactory:386 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
19:41:58,621  INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
19:41:58,621  INFO SettingsFactory:225 - Query language substitutions: {}
19:41:58,621  INFO SettingsFactory:230 - JPA-QL strict compliance: enabled
19:41:58,621  INFO SettingsFactory:235 - Second-level cache: enabled
19:41:58,621  INFO SettingsFactory:239 - Query cache: disabled
19:41:58,621  INFO SettingsFactory:373 - Cache provider: org.hibernate.cache.NoCacheProvider
19:41:58,621  INFO SettingsFactory:254 - Optimize cache for minimal puts: disabled
19:41:58,621  INFO SettingsFactory:263 - Structured second-level cache entries: disabled
19:41:58,636  INFO SettingsFactory:283 - Echoing all SQL to stdout
19:41:58,636  INFO SettingsFactory:290 - Statistics: disabled
19:41:58,636  INFO SettingsFactory:294 - Deleted entity synthetic identifier rollback: disabled
19:41:58,636  INFO SettingsFactory:309 - Default entity-mode: pojo
19:41:58,636  INFO SettingsFactory:313 - Named query checking : enabled
19:41:58,761  INFO SessionFactoryImpl:161 - building session factory
19:41:59,324  INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
19:41:59,808 DEBUG SQL:401 - select nextval ('books_id_seq')
Hibernate: select nextval ('books_id_seq')
19:42:00,152  INFO SessionFactoryImpl:769 - closing
19:42:00,152  INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:postgresql://localhost:5432/er

As you see log doesn't show any error.


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

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.