-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate 3 INSERT fires - does not create record in Oracle
PostPosted: Fri Aug 19, 2011 4:07 pm 
Newbie

Joined: Tue Aug 16, 2011 9:35 am
Posts: 2
I have created a small app. using SmartGWT 2.5 and Spring/Hibernate for persistence to support basic CRUD operations. When I attempt to create a new employee record, I can see the insert stmt. being constructed (format_sql is set to true in my ...cfg.xml file), but the record does not make it into the database and it appears that no SQL exceptions are being thrown.

I have the insert call coded as follows in my DAO:

Code:
Session hibernateSession = sessionFactory.openSession();
Transaction t = null;
try {
    t=hibernateSession.beginTransaction();
    hibernateSession.save(item)
    t.commit()
} catch(Exception e) {
   t.rollback()
} finally {
    if (hibernateSession != null)
        hibernateSession.close()
}


In the console, I see the following:

Hibernate:
insert into
TEST.EMP
(COMM, ENAME, HIREDATE, JOB, MGR, MGRNAME, SAL, EMPNO)
values
(?, ?, ?, ?, ?, ?, ?, ?)

hbm2ddl.auto is set to update

I am using annotations so the bean id class attribute for the "hibernateSessionFactory" is set to "org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean".

Any ideas as to why the record is not being inserted?


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

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.