-->
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.  [ 4 posts ] 
Author Message
 Post subject: insert and delete in same session
PostPosted: Fri Mar 03, 2006 10:34 pm 
Newbie

Joined: Fri Mar 03, 2006 10:29 pm
Posts: 3
Hibernate version:
3.1

Code between sessionFactory.openSession() and session.close():
I insert an Object with saveOrUpdate because i need the generated Id.
then (in some cases) I need to delete the Object. Everything in the same Session and Thread.

HibernateUtil.beginTransaction();
makePersistent(myObject);
makeTransient(myObject);
HibernateUtil.commitTransaction();

Name and version of the database you are using:
MYSQL 4.1

The generated SQL (show_sql=true):
The only SQL Code is the insert statement

Debug level Hibernate log excerpt:

Best regards and thanks for suggestions


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 3:22 am 
Regular
Regular

Joined: Tue Dec 14, 2004 5:21 am
Posts: 104
Location: india
can u breif a little more on it

_________________
sHeRiN
thanks for your ratings ...... :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 11:25 am 
Newbie

Joined: Fri Mar 03, 2006 10:29 pm
Posts: 3
Shure,
its very simple:
I upload a File and insert it into my database (the filename).
I do this to name the uploaded file after the id of the inserted object.

Then i do certain checks like file size and file type.
If the uploaded doesnt pass my checks i have to delete the database entry.

Everything works except of the deletion of the object.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 12:04 pm 
Newbie

Joined: Fri Mar 03, 2006 10:29 pm
Posts: 3
I solved the problem. I forgot the Filtermapping, just had the Filter in my web.xml.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.