-->
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.  [ 2 posts ] 
Author Message
 Post subject: Detach object from session
PostPosted: Fri Oct 15, 2004 10:42 am 
Beginner
Beginner

Joined: Fri Oct 15, 2004 10:29 am
Posts: 21
What is the correct way to detach a loaded object from the session in the session per request design pattern?


Hibernate version:
2.1.3

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping package="com.skillsoft.mgs.email">
<class mutable="false" name="EmailTemplateBean" table="emailTemplate">
<id name="ID" column="ID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="name" column="name"/>
<property name="descr" column="description"/>
<property name="from" column="fromAddress"/>
<property name="to" column="toAddresses"/>
<property name="cc" column="cc"/>
<property name="bcc" column="bcc"/>
<property name="subject" column="subject"/>
<property name="body" column="body"/>
<property name="calendarAppointment" column="calendarAppointment"/>
<property name="enabled" column="enabled"/>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
SQL Server 2000

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 15, 2004 10:44 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
just get the persistent object and close the session then.
You can also check session.evict(obj)

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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