Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3677558
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:14:09+00:00 2026-05-19T03:14:09+00:00

learning Hibernate and its really making me crazy i am trying to persist an

  • 0

learning Hibernate and its really making me crazy i am trying to persist an entity class along with its chilren and here is the method which is doing this for me

log.info("About to persist the given Entity instance");
        Session session=HibernateSessionFactory.getSessionfactory().openSession();
        Transaction tx=session.getTransaction();
        try{
            tx.begin();
            session.saveOrUpdate(entity);
            tx.commit();
        }
        catch(Exception e){
            tx.rollback();
        }
        finally{
            session.close();
        }
        return entity;
    }

everything seems ok and here is the console output i am totaly cluless hibernate is not showing any exception nor its saving anything in the database

23:47:08,627  INFO GenericDAOImpl:172 - About to persist the given Entity instance
2011-01-09 23:47:08,627 [http-8080-3] INFO  com.raisonne.tr.dao.impl.GenericDAOImpl - About to persist the given Entity instance
9 Jan, 2011 11:47:08 PM org.hibernate.impl.SessionFactoryImpl close
INFO: closing
9 Jan, 2011 11:47:08 PM org.hibernate.connection.DriverManagerConnectionProvider close
INFO: cleaning up connection pool: jdbc:mysql://localhost/travellingrants
9 Jan, 2011 11:47:08 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
9 Jan, 2011 11:47:08 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
9 Jan, 2011 11:47:08 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: false
9 Jan, 2011 11:47:08 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/travellingrants
9 Jan, 2011 11:47:08 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=root, password=****}
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: MySQL, version: 5.1.51-community
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.13 ( Revision: ${bzr.revision-id} )
9 Jan, 2011 11:47:08 PM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.MySQLDialect
9 Jan, 2011 11:47:08 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Using default transaction strategy (direct JDBC transactions)
9 Jan, 2011 11:47:08 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch size: 15
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch updates for versioned data: disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): enabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default schema: travellingrants
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Maximum outer join fetch depth: 2
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: enabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL inserts for batching: disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
9 Jan, 2011 11:47:08 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory createRegionFactory
INFO: Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
9 Jan, 2011 11:47:08 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
9 Jan, 2011 11:47:08 PM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
9 Jan, 2011 11:47:08 PM org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured

can any one having idea about hiberntae suggest me what is wrong all i can see some suspicious lines of log entires

9 Jan, 2011 11:47:08 PM org.hibernate.impl.SessionFactoryImpl close
INFO: closing
9 Jan, 2011 11:47:08 PM org.hibernate.connection.DriverManagerConnectionProvider close
INFO: cleaning up connection pool: jdbc:mysql://localhost/travellingrants

but really clueless what it is

Edit1
here is the parent mapping file

<hibernate-mapping>
    <class name="com.raisonne.tr.model.destination.Destination" table="DESTINATION">
       <id name="uuid" type="java.lang.String">
                 <column name="UUID" />
                 <generator class="uuid"/>
      </id>
        <property name="destinationID" type="java.lang.String" not-null="true">
            <column name="DESTINATIONID" />
        </property>
        <property name="name" type="java.lang.String" not-null="true">
            <column name="NAME" />
        </property>
        <property name="shortDescription" type="java.lang.String">
            <column name="SHORTDESCRIPTION" />
        </property>
        <property name="longDescription" type="java.lang.String">
            <column name="LONGDESCRIPTION" />
        </property>

        <set name="airTransport" table="AIRTRANSPORT" inverse="true" lazy="true" cascade="save-update">
            <key>
                <column name="DESTINATIONID" />
            </key>
            <one-to-many class="com.raisonne.tr.model.destination.destinationattributes.AirTransport" />
        </set>
        <set name="roadTransport" table="ROADTRANSPORT" inverse="true" lazy="true" cascade="save-update">
            <key>
                <column name="DESTINATIONID" />
            </key>
            <one-to-many class="com.raisonne.tr.model.destination.destinationattributes.RoadTransport" />
        </set>
        <set name="trainTransport" table="TRAINTRANSPORT" inverse="true" lazy="true" cascade="save-update">
            <key>
                <column name="DESTINATIONID" />
            </key>
            <one-to-many class="com.raisonne.tr.model.destination.destinationattributes.TrainTransport" />
        </set>

        <set name="emergencyContact" table="EMERGENCYCONTACT" inverse="true" lazy="true" cascade="save-update">
            <key>
                <column name="DESTINATIONID" />
            </key>
            <one-to-many class="com.raisonne.tr.model.destination.destinationattributes.EmergencyContact" />
        </set>

        <set name="placesToVisit" table="PLACETOVISIT" inverse="true" lazy="true" cascade="save-update">
            <key>
                <column name="DESTINATIONID" />
            </key>
            <one-to-many class="com.raisonne.tr.model.destination.destinationattributes.PlaceToVisit" />
        </set>
        <set name="news" table="NEWS" inverse="true" lazy="true" cascade="save-update">
            <key>
                <column name="DESTINATIONID" />
            </key>
            <one-to-many class="com.raisonne.tr.model.news.News" />
        </set>
        <set name="userComments" table="USERCOMMENT" inverse="true" lazy="true" cascade="save-update">
            <key>
                <column name="DESTINATIONID" />
            </key>
            <one-to-many class="com.raisonne.tr.model.user.UserComment" />
        </set>
        <set name="address" table="BASICADDRESS" inverse="true" lazy="true" cascade="save-update">
            <key>
                <column name="DESTINATIONID" />
            </key>
            <one-to-many class="com.raisonne.tr.model.address.BasicAddress" />
        </set>
        <set name="categories" table="CATEGORY" inverse="true" lazy="true" cascade="save-update">
            <key>
                <column name="DESTINATIONID" />
            </key>
            <one-to-many class="com.raisonne.tr.model.category.Category" />
        </set>
    </class>
</hibernate-mapping>

and child mapping file has entries as below.

<hibernate-mapping>
    <class name="com.raisonne.tr.model.destination.destinationattributes.PlaceToVisit" table="PLACETOVISIT">
        <id name="uuid" type="java.lang.String">
            <column name="UUID" />
            <generator class="uuid" />
        </id>
        <property name="name" type="java.lang.String">
            <column name="NAME" />
        </property>
        <many-to-one name="destination" class="com.raisonne.tr.model.destination.Destination" fetch="join">
            <column name="DESTINATION" />
        </many-to-one>
        </class>
</hibernate-mapping>
  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:14:10+00:00Added an answer on May 19, 2026 at 3:14 am

    Try repleacing catch in you code with

    catch(Exception e){
                Logger.getAnonymousLogger().log(Level.SEVERE, e.getLocalizedMessage());
                tx.rollback();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to hibernate world, still learning it. I am trying to persist
I'm still learning what hibernate can do and this time i'm trying something that
I have been still learning Hibernate and I need to develope application which can
Learning Spring MVC and Hibernate. import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity
I'm learning Java EE 6 and I'm beginning with basic tutorials trying to really
learning html/css here. I'm trying to add a border-bottom to my .menu ul li
I just started learning hibernate last night and its rather fun. I am some
here i am again in my self learning hibernate and personal experiment project to
I am new to Spring MVC and Hibernate and am learning along the way.
I am learning Hibernate from beginning. I downloaded hibernated demo from RoseIndia. Setup configuration

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.