-->
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: Can't catch Exception
PostPosted: Thu Feb 17, 2005 8:01 pm 
Newbie

Joined: Thu Feb 17, 2005 7:40 pm
Posts: 1
Location: Calgary, Alberta, Canada
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3 b4

Mapping documents: N/A

Code between sessionFactory.openSession() and session.close():
Session session = sessionFactory.openSession();
try {
tx = session.beginTransaction();
session.save(e911);
session.flush();
commit(e911);
} catch (Exception e) {
tx.rollback();
throw new NestedRuntimeException(e);
}
finally {
session.close();
}
Full stack trace of any exception that occurs: N/A

Name and version of the database you are using: Oracle 8.1.7.4

The generated SQL (show_sql=true):
insert into E911 (npa, nxx, line, street_name, street_direction, street_suffix, plec_id, transaction_code, e911_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?)

Debug level Hibernate log excerpt: N/A

Hello, we have just finished setting up Hibernate and have created a simple test to insert records into a table called E911. The E911 table contains a constraint on a column - plec_id - that does not allow null values. A standard insert with a value in the plec_id works okay, but when we try to insert with a null value in place of the attribute, we DON'T seem to be getting an Exception as expected. In the logs, we can see that a SQLException was found, but for some reason, the code (as seen above) for which we are saving the transaction processes all the way through and no exception is caught.
Has anyone encountered this problem? Is there something we are missing in the configuration? Any assistance will be greatly appreciated.

Thanks,
Tommy


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.