-->
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.  [ 9 posts ] 
Author Message
 Post subject: Reference to object is still being maintained
PostPosted: Thu Oct 21, 2004 3:52 am 
Newbie

Joined: Thu Oct 21, 2004 3:28 am
Posts: 8
Hibernate version: 2.0

[b]Mapping documents:NONE
[b]Code between sessionFactory.openSession() and session.close():
N.A
Full stack trace of any exception that occurs: N.A.
Name and version of the database you are using: Oracel 8 i
The generated SQL (show_sql=true): NONE
Debug level Hibernate log excerpt: NONE

Hi,
I am currently working on a web application and we are using Hibernate 2.0. There is a strange problem that we are facing and it is as follows:
The reference to an object that was used to insert is still maintained in the session and when one tries to retrieve records, on session.flush(), an insertion of the object takes place, thereby throwing an error. This problem does not occur regularly and a restart of the server solves the problem.The application is hosted on SUN one application server 7.0. If some one can shed some light on this front it will be great.
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 21, 2004 4:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
If you posted the error/stacktrace we might be able to help ;)

But besides the error thrown nothing else sounds weird - Hibernates only goes to the database when needed, e.g. when you are about to do a query on a open session we will perform waiting insert/updates/deletions before performing the query.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 21, 2004 4:24 am 
Newbie

Joined: Thu Oct 21, 2004 3:28 am
Posts: 8
Hi,
thanks for the quick reply, I am pasting the error trace. If you have a look at the error trace, it says error occured while trying to insert TopicDetailRow. Now the problem is that this error was thrown while retrieving values from a table that is not associated with the TopicDetailRow(Java object mapped to a table in the DB) object. I have no clue as to why this error is thrown, but it looks like an insert failed and the object is still in the hibernate session and on doing a session.flush(), hibernate is trying to insert the object. On restarting the server, this problem disappeared. Could you shed some light on this...

,[com.ge.erc.uww.actuarial.data.hibernate.UserProfileInvocation] (19
10 200410:15:10) ERROR - HibernateException:could not insert:
[com.ge.erc.uww.actuarial.ro.TopicDetailRow#188]
net.sf.hibernate.JDBCException: could not insert:
[com.ge.erc.uww.actuarial.ro.TopicDetailRow#188]
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:478)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at
net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at
net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2335)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
at
com.ge.erc.uww.actuarial.data.hibernate.UserProfileInvocation.getUserProfile
Values(UserProfileInvocation.java:218)
at
com.ge.erc.uww.actuarial.service.UWWCacheManagerService.fetchUserProfileTabl
eValues(UWWCacheManagerService.java:790)
at
com.ge.erc.uww.actuarial.ejb.UserBean.fetchUserProfileValues(UserBean.java:6
9)
at
com.ge.erc.uww.actuarial.ejb.UserBean_EJBLocalObjectImpl.fetchUserProfileVal
ues(UserBean_EJBLocalObjectImpl.java:59)
at sun.reflect.GeneratedMethodAccessor1427.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.ge.erc.uww.actuarial.delegate.BusinessDelegate.invoke(BusinessDelegate.j
ava:190)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestActionHelper.fetchUserP
rofileValues(ReferralSearchRequestActionHelper.java:987)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestAction.searchRequest(Re
ferralSearchRequestAction.java:435)
at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:
280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
com.ge.erc.uww.actuarial.action.BaseDispatchAction.execute(BaseDispatchActio
n.java:142)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(Requ
estProcessor.java:1012)
at
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.ja
va:582)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardW
rapperValve.java:720)
at
org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValv
e.java:118)
at
org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.jav
a:278)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:274)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:212)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203
)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.ja
va:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
Caused by: java.sql.SQLException: Data size bigger than max size for this
type: 5636
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:126)
at
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1784)
at
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.j
ava:875)
at
oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement
.java:1257)
at net.sf.hibernate.type.StringType.set(StringType.java:26)
at
net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:48)
at
net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
at
net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:39
3)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466)
... 66 more
[com.ge.erc.uww.actuarial.exception.ActuarialException] (19 10 200410:15:10)
ERROR - error.fetchuserprofile.hibernate
net.sf.hibernate.JDBCException: could not insert:
[com.ge.erc.uww.actuarial.ro.TopicDetailRow#188]
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:478)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at
net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at
net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2335)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
at
com.ge.erc.uww.actuarial.data.hibernate.UserProfileInvocation.getUserProfile
Values(UserProfileInvocation.java:218)
at
com.ge.erc.uww.actuarial.service.UWWCacheManagerService.fetchUserProfileTabl
eValues(UWWCacheManagerService.java:790)
at
com.ge.erc.uww.actuarial.ejb.UserBean.fetchUserProfileValues(UserBean.java:6
9)
at
com.ge.erc.uww.actuarial.ejb.UserBean_EJBLocalObjectImpl.fetchUserProfileVal
ues(UserBean_EJBLocalObjectImpl.java:59)
at sun.reflect.GeneratedMethodAccessor1427.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.ge.erc.uww.actuarial.delegate.BusinessDelegate.invoke(BusinessDelegate.j
ava:190)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestActionHelper.fetchUserP
rofileValues(ReferralSearchRequestActionHelper.java:987)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestAction.searchRequest(Re
ferralSearchRequestAction.java:435)
at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:
280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
com.ge.erc.uww.actuarial.action.BaseDispatchAction.execute(BaseDispatchActio
n.java:142)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(Requ
estProcessor.java:1012)
at
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.ja
va:582)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardW
rapperValve.java:720)
at
org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValv
e.java:118)
at
org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.jav
a:278)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:274)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:212)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203
)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.ja
va:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
Caused by: java.sql.SQLException: Data size bigger than max size for this
type: 5636
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:126)
at
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1784)
at
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.j
ava:875)
at
oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement
.java:1257)
at net.sf.hibernate.type.StringType.set(StringType.java:26)
at
net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:48)
at
net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
at
net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:39
3)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466)
... 66 more
[com.ge.erc.uww.actuarial.ejb.UserBean] (19 10 200410:15:10) ERROR -
exception in UserBean ejb for method fetchUserProfileValues<
com.ge.erc.uww.actuarial.exception.ActuarialException:
error.fetchuserprofile.hibernate
at
com.ge.erc.uww.actuarial.data.hibernate.UserProfileInvocation.getUserProfile
Values(UserProfileInvocation.java:228)
at
com.ge.erc.uww.actuarial.service.UWWCacheManagerService.fetchUserProfileTabl
eValues(UWWCacheManagerService.java:790)
at
com.ge.erc.uww.actuarial.ejb.UserBean.fetchUserProfileValues(UserBean.java:6
9)
at
com.ge.erc.uww.actuarial.ejb.UserBean_EJBLocalObjectImpl.fetchUserProfileVal
ues(UserBean_EJBLocalObjectImpl.java:59)
at sun.reflect.GeneratedMethodAccessor1427.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.ge.erc.uww.actuarial.delegate.BusinessDelegate.invoke(BusinessDelegate.j
ava:190)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestActionHelper.fetchUserP
rofileValues(ReferralSearchRequestActionHelper.java:987)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestAction.searchRequest(Re
ferralSearchRequestAction.java:435)
at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:
280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
com.ge.erc.uww.actuarial.action.BaseDispatchAction.execute(BaseDispatchActio
n.java:142)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(Requ
estProcessor.java:1012)
at
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.ja
va:582)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardW
rapperValve.java:720)
at
org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValv
e.java:118)
at
org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.jav
a:278)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:274)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:212)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203
)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.ja
va:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
[com.ge.erc.uww.actuarial.delegate.BusinessDelegate] (19 10 200410:15:10)
ERROR - Exception is an instance of ActuarialException ******
com.ge.erc.uww.actuarial.exception.ActuarialException:
error.fetchuserprofile.hibernate
at
com.ge.erc.uww.actuarial.data.hibernate.UserProfileInvocation.getUserProfile
Values(UserProfileInvocation.java:228)
at
com.ge.erc.uww.actuarial.service.UWWCacheManagerService.fetchUserProfileTabl
eValues(UWWCacheManagerService.java:790)
at
com.ge.erc.uww.actuarial.ejb.UserBean.fetchUserProfileValues(UserBean.java:6
9)
at
com.ge.erc.uww.actuarial.ejb.UserBean_EJBLocalObjectImpl.fetchUserProfileVal
ues(UserBean_EJBLocalObjectImpl.java:59)
at sun.reflect.GeneratedMethodAccessor1427.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.ge.erc.uww.actuarial.delegate.BusinessDelegate.invoke(BusinessDelegate.j
ava:190)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestActionHelper.fetchUserP
rofileValues(ReferralSearchRequestActionHelper.java:987)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestAction.searchRequest(Re
ferralSearchRequestAction.java:435)
at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:
280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
com.ge.erc.uww.actuarial.action.BaseDispatchAction.execute(BaseDispatchActio
n.java:142)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(Requ
estProcessor.java:1012)
at
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.ja
va:582)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardW
rapperValve.java:720)
at
org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValv
e.java:118)
at
org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.jav
a:278)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:274)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:212)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203
)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.ja
va:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
[com.ge.erc.uww.actuarial.delegate.BusinessDelegate] (19 10 200410:15:10)
ERROR - t.getMessage() error.fetchuserprofile.hibernate
[com.ge.erc.uww.actuarial.exception.ActuarialException] (19 10 200410:15:10)
ERROR - error.fetchuserprofile.hibernate
com.ge.erc.uww.actuarial.exception.ActuarialException:
error.fetchuserprofile.hibernate
at
com.ge.erc.uww.actuarial.data.hibernate.UserProfileInvocation.getUserProfile
Values(UserProfileInvocation.java:228)
at
com.ge.erc.uww.actuarial.service.UWWCacheManagerService.fetchUserProfileTabl
eValues(UWWCacheManagerService.java:790)
at
com.ge.erc.uww.actuarial.ejb.UserBean.fetchUserProfileValues(UserBean.java:6
9)
at
com.ge.erc.uww.actuarial.ejb.UserBean_EJBLocalObjectImpl.fetchUserProfileVal
ues(UserBean_EJBLocalObjectImpl.java:59)
at sun.reflect.GeneratedMethodAccessor1427.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.ge.erc.uww.actuarial.delegate.BusinessDelegate.invoke(BusinessDelegate.j
ava:190)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestActionHelper.fetchUserP
rofileValues(ReferralSearchRequestActionHelper.java:987)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestAction.searchRequest(Re
ferralSearchRequestAction.java:435)
at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:
280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
com.ge.erc.uww.actuarial.action.BaseDispatchAction.execute(BaseDispatchActio
n.java:142)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(Requ
estProcessor.java:1012)
at
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.ja
va:582)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardW
rapperValve.java:720)
at
org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValv
e.java:118)
at
org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.jav
a:278)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:274)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:212)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203
)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.ja
va:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
[com.ge.erc.uww.actuarial.action.ReferralSearchRequestAction] (19 10
200410:15:10) ERROR - Error code received error.fetchuserprofile.hibernate
com.ge.erc.uww.actuarial.exception.ActuarialException:
error.fetchuserprofile.hibernate
at
com.ge.erc.uww.actuarial.delegate.BusinessDelegate.invoke(BusinessDelegate.j
ava:219)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestActionHelper.fetchUserP
rofileValues(ReferralSearchRequestActionHelper.java:987)
at
com.ge.erc.uww.actuarial.action.ReferralSearchRequestAction.searchRequest(Re
ferralSearchRequestAction.java:435)
at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:
280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
com.ge.erc.uww.actuarial.action.BaseDispatchAction.execute(BaseDispatchActio
n.java:142)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:757)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatc
her.java:123)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:138)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:374)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
at
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(Requ
estProcessor.java:1012)
at
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.ja
va:582)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardW
rapperValve.java:720)
at
org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValv
e.java:118)
at
org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.jav
a:278)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:274)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:212)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203
)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.ja
va:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 21, 2004 5:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
How about you tried checking your exceptions before posting ? :)

This was listed as the nested exception!

"Caused by: java.sql.SQLException: Data size bigger than max size for this type: 5636"

So, go fix that first!

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 21, 2004 6:52 am 
Newbie

Joined: Thu Oct 21, 2004 3:28 am
Posts: 8
Hi,
That is already fixed sir, what I would like to know is, how do I ensure that when an exception is thrown , the object reference is removed.If you can help me please let me know..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 21, 2004 7:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
As per the documentation - if an exception occurs => discard the session!

Do NOT reuse the session if an exception occurs.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 21, 2004 7:16 am 
Newbie

Joined: Thu Oct 21, 2004 3:28 am
Posts: 8
This is the piece of code that we are using for accessing Hibernate: Please have a look at it and let me know if they way we are obtaining and killing the session is right:

package com.ge.erc.uww.actuarial.data.hibernate;

import com.ge.erc.uww.actuarial.exception.ActuarialException;
import com.ge.erc.uww.actuarial.util.ActuarialConstants;
import com.ge.erc.uww.actuarial.util.DBConnection;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Session;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.cfg.Configuration;

import org.apache.log4j.Logger;

import java.sql.SQLException;

/**
*
* Hibernate Implementation class
*
*/
public class HibernateSession {
private static String olaSchema = ActuarialConstants.OLA_SCHEMA_OWNER;
private static String gusSchema = ActuarialConstants.GUS_SCHEMA_OWNER;
private static String uwwSchema = ActuarialConstants.UWW_SCHEMA_OWNER;
private static SessionFactory sessionFactory;

public static final ThreadLocal OLA_SESSION = new ThreadLocal();

public static final ThreadLocal UWW_SESSION = new ThreadLocal();

public static final ThreadLocal GUS_SESSION = new ThreadLocal();

private static Logger logger =
Logger.getLogger (HibernateSession.class.getName ());

/**
* get current OLA session
*/
public static Session currentOLASession ()
throws ActuarialException {
return currentSession (olaSchema);
}

/**
* Get current UWW session
*/
public static Session currentUWWSession ()
throws ActuarialException {
return currentSession (uwwSchema);
}

/**
* Fetches the current session for the specified schema. Used internally by
* other wrapper methods
* Initializes the session-factory and sessions if not initialized
* @param schemaName
* @return session
* @exception ActuarialException
* <b>Preconditions:</b><br>
* <ol>
* <li>schemaName should not be empty</li>
* </ol>
*
*/
private static Session currentSession (String schemaName)
throws ActuarialException {
Session session = null;

try {
logger.debug ("currentSession>");
session = getSession (schemaName);
logger.debug ("session : " + session);

if (
(session == null) ||
((session != null) && !session.isConnected ())) {
// Don't get from JNDI, use a static SessionFactory
if (sessionFactory == null) {
// Use default hibernate.cfg.xml
sessionFactory =
new Configuration().configure ().buildSessionFactory ();
logger.debug ("sessionFactory was null");
}

logger.debug ("sessionfactory:" + sessionFactory);

if (olaSchema.equalsIgnoreCase (schemaName)) {
session =
sessionFactory.openSession (
DBConnection.getOLAConnection ());
logger.debug ("Opened session with OLAConnection");
} else {
session =
sessionFactory.openSession (
DBConnection.getConnection ());
logger.debug ("Opened session with UWW Connection");
}

logger.debug ("session opened:" + session);
setSession (session, schemaName);
logger.debug ("session set to factory");
}
} catch (HibernateException he) {
logger.error ("HibernateException:" + he.getMessage (), he);
throw new ActuarialException("error.hibernate.currentSession", he);
}

logger.debug ("currentSession<");

return session;
}

/**
* This method closes all the sessions.
* @exception ActuarialException
*/
public static void closeSession ()
throws ActuarialException {
logger.debug ("closeSession>");

try {
closeOLASession ();
closeUWWSession ();
} catch (HibernateException he) {
logger.error ("HibernateException:" + he.getMessage (), he);
throw new ActuarialException("error.hibernate.closingSession", he);
} catch (SQLException se) {
logger.error ("SQLException:" + se.getMessage (), se);
throw new ActuarialException("error.hibernate.closingSession", se);
}

logger.debug ("closeSession<");
}

/**
* This method closes the UWW session.
* @exception ActuarialException
* @exception SQLException
*/
public static void closeUWWSession ()
throws HibernateException, SQLException {
logger.debug ("closeUWWSession>");

Session session = ( Session ) UWW_SESSION.get ();
logger.debug ("s:" + session);

if ((session != null) && (session.connection () != null)) {
logger.debug (
"s.connection().isClosed():" +
session.connection ().isClosed ());
}

if (
(session != null) &&
(session.connection () != null) &&
!(session.connection ().isClosed ())) {
session.connection ().close ();
logger.debug ("connection closed");
}

UWW_SESSION.set (null);

if (session != null) {
session.close ();
}

logger.debug ("closeUWWSession<");
}

/**
* This method closes the OLA session.
* @exception ActuarialException
* @exception SQLException
*/
public static void closeOLASession ()
throws HibernateException, SQLException {
logger.debug ("closeOLASession>");

Session session = ( Session ) OLA_SESSION.get ();
logger.debug ("session:" + session);

if ((session != null) && (session.connection () != null)) {
logger.debug (
"session.connection().isClosed():" +
session.connection ().isClosed ());
}

if (
(session != null) &&
(session.connection () != null) &&
!(session.connection ().isClosed ())) {
session.connection ().close ();
logger.debug ("connection closed");
}

OLA_SESSION.set (null);

if (session != null) {
session.close ();
}

logger.debug ("closeOLASession<");
}

/**
* This method fetches the session for the respective schema name.
* @param schemaName
* @return Session
* <b>Preconditions:</b><br>
* <ol>
* <li>schemaName should not be empty/null</li>
* </ol>
*
*/
private static Session getSession (String schemaName) {
logger.debug ("getSession>");

Session session = null;

if (olaSchema.equalsIgnoreCase (schemaName)) {
session = ( Session ) OLA_SESSION.get ();
} else if (gusSchema.equalsIgnoreCase (schemaName)) {
session = ( Session ) GUS_SESSION.get ();
} else {
session = ( Session ) UWW_SESSION.get ();
}

logger.debug ("getSession<");

return session;
}

/**
* This method is used to set the session for the respective schema name.
* @param schemaName
* @param session
* @return Session
* <b>Preconditions:</b><br>
* <ol>
* <li>session should not be null</li>
* <li>schemaName should not be empty/null</li>
* </ol>
*
*/
private static void setSession (Session session, String schemaName) {
logger.debug ("setSession>");

if (olaSchema.equalsIgnoreCase (schemaName)) {
OLA_SESSION.set (session);
} else if (gusSchema.equalsIgnoreCase (schemaName)) {
GUS_SESSION.set (session);
} else {
UWW_SESSION.set (session);
}

logger.debug ("setSession<");
}
}


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 21, 2004 7:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I don't wanna debug partial code.

There is nothing to it - you simply do not USE a session after an exception has occurred! How hard can that be ? ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 21, 2004 7:43 am 
Newbie

Joined: Thu Oct 21, 2004 3:28 am
Posts: 8
thanks a ton!!! you have been of great help!!!
PS: I always use a new session when an exception occurs, trust me I have tried all that..only after trying everything have I come to this forum Thank You


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