facebook

Persistence problem in Hibernate-Spring project

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #275641 Reply

    kmalinow
    Member

    This message has not been recovered.

    #275732 Reply

    Riyad Kalla
    Member

    This message has not been recovered.

    #275874 Reply

    kmalinow
    Member

    This message has not been recovered.

    #275915 Reply

    Riyad Kalla
    Member

    This message has not been recovered.

    #278443 Reply

    jcristini
    Member

    I am having this same problem and I have tried to wrap it with a transaction.begin and commit. Could someone please post an example showing how to create the transaction and close the transaction.

    I have tried:
    public void save(Goal transientInstance) {
    log.debug(“saving Goal instance”);
    try {

    Session session = getSession();
    Transaction tx = session.beginTransaction();
    getHibernateTemplate().save(transientInstance);
    tx.commit();
    session.close();
    log.debug(“save successful”);
    } catch (RuntimeException re) {
    log.error(“save failed”, re);
    throw re;
    }
    }

    thanks,
    J

    #278445 Reply

    jcristini
    Member

    I have also tried getting the session using the generated HibernateSessionFactory.getSession().

    #278510 Reply

    jcristini
    Member

    I figured it out. I created my MySql table with type as “InnoDB” when I switched it to type “MyISAM” it began to persist to the database. I was able to get it to persist with and with out wrapping it with a transaction. I hope this saves someone some time in the future.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Persistence problem in Hibernate-Spring project

You must be logged in to post in the forum log in