-->
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.  [ 3 posts ] 
Author Message
 Post subject: LazyInitialization errors
PostPosted: Thu Nov 09, 2006 1:29 pm 
Newbie

Joined: Wed Nov 08, 2006 7:42 pm
Posts: 2
Go easy on me, I'm a mere techie. I'm in a new environment where were using Websphere\Solaris to host our apps, and they connect to Oracle\Solaris on the back end. We also use the 'suspicious' tool Mercury Diagnostics Profiler for J2EE in development to gather stats, performance data, etc. Evidentally everything's been running fine for a year or so, and recently a new application has been added. Since then, 'out of memory' errors are are frequent, and a memory leak in the new application is apparent. The developer comes in yesterday and informs me that the cause is a conflict in the new websphere application, and our Mercury monitoring tool. His evidence is this (look for com.mercury.opal):

************ Start Display Current Environment ************
WebSphere Platform 6.0 [ND 6.0.2.11 cf110623.10] running with process name serverNode01Cell\serverNode01\server1 and process id 29284
Host Operating System is SunOS, version 5.9
Java version = 1.4.2_11, Java Compiler = null, Java VM name = Java HotSpot(TM) Client VM
was.install.root = /usr/websphere/appserver
user.install.root = /usr/websphere/appserver/profiles/serverNode
Java Home = /usr/websphere/appserver/java/jre
ws.ext.dirs = /usr/websphere/appserver/java/lib:/usr/websphere/appserver/profiles/serverNode/classes:/usr/websphere/appserver/classes:/usr/websphere/appserver/lib:/usr/websphere/appserver/installedChannels:/usr/websphere/appserver/lib/ext:/usr/websphere/appserver/web/help:/usr/websphere/appserver/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime
Classpath = /usr/websphere/appserver/profiles/serverNode/properties:/usr/websphere/appserver/properties:/usr/websphere/appserver/lib/bootstrap.jar:/usr/websphere/appserver/lib/j2ee.jar:/usr/websphere/appserver/lib/lmproxy.jar:/usr/websphere/appserver/lib/urlprotocols.jar:/usr/websphere/appserver/mercprobe/etc
Java Library path = /usr/websphere/appserver/java/jre/lib/sparc/client:/usr/websphere/appserver/java/jre/lib/sparc:/usr/websphere/appserver/java/jre/../lib/sparc:/usr/websphere/appserver/bin:/opt/mqm/java/lib:/opt/wemps/lib::/usr/lib
************* End Display Current Environment *************
[11/2/06 9:48:49:751 MST] 00000025 LazyInitializ E org.hibernate.LazyInitializationException <init> failed to lazily initialize a collection of role: com.company.pc.sql.hibernate.usersecurity.HbmUserGroup.Permissions, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.company.pc.sql.hibernate.usersecurity.HbmUserGroup.Permissions, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
at org.hibernate.collection.PersistentSet.size(PersistentSet.java:114)
at com.mercury.opal.capture.LWMDCaptureAgent$CollectionSizeCalculator.getCollectionSize(LWMDCaptureAgent.java:1364)
at com.mercury.opal.capture.LWMDCaptureAgent$LWMDData.getCollectionSize(LWMDCaptureAgent.java:1231)
at com.mercury.opal.capture.LWMDCaptureAgent$LWMDData.sample(LWMDCaptureAgent.java:1337)
at com.mercury.opal.capture.LWMDCaptureAgent.run(LWMDCaptureAgent.java:566)
at java.lang.Thread.run(Thread.java:534)

I'm not a developer, but it seems improbable to me that Mercury is causing this error ... LazyInitialization problems seem to be covered in great detail on this site, and seem pretty common. Can anyone help. I'm looking first for some support (if I'm even correct) that this is something that can be resolved by modifying the code. I guess I'm secondarily looking for actual advise I can give my developer on how to correct this. Let me know what else I can provide, I really have no idea what to post at this point. Thanks !!!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 09, 2006 3:27 pm 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
Your profiling tool is attempting to profile a collection which was intiialized with a proxy. When the profiler attempts to read the data from the lazily initialized collection, Hibernate is attempting to resolve the data to a real set by running SQL statements, but the connection that runs the SQL statements has been previously closed. Hence, the lazy initialization errors. Either do not use the profiler to profile the application, or adjust its settings so that it does not profile collections under the org.hibernate.collection package.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 09, 2006 3:37 pm 
Newbie

Joined: Wed Nov 08, 2006 7:42 pm
Posts: 2
Thank you SO much. I think I found the where to make that modification, it's something I can simply 'rem' out of a properties file.


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