Sameera Abeysekara Gunawardena

Ranch Hand
+ Follow
since Feb 22, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sameera Abeysekara Gunawardena

OK I will see Is there any memory leaks using you suggested tools.

Thanks for your grate advices i really appreciated.

Best Regards
Sameera

So, re-reading your original problem. Do you actually have out of memory errors? Or are you just worried this may cause them? The awaiting command state shouldn't be causing much in the way of memory issues in Tomcat.



Yes I worried this may cause them.so how can be raised out of memory error i checked other codes very well.
Do you know about good memory profiling tool.
No I trying to tell when i use transactions within the this application.
I am properly ended every transaction.

Can you send sample code for how can use transaction and how can transaction ended properly in using hibernate
No i don't use the transaction when i select some thing.I want to update database.

What are transaction for? They are for ensuring data integrity during updates


i couldn't understand above what you tiring to tel.
i need to doing read transaction. if not how can i the get data from data base.i am not clear your solution please explain.
I write commit code statement after every read transactions but still occurred that problem dont you know any solution
to avoid this problem.

properly end the transaction when you've finished with it.



What you mean in above sentence How can i properly end read transaction
Cameron McKenzie

How are you doing the transaction?


What you mean in this question

Is it one transaction per request, or do you have multiple transactions per request?


Only one transaction per request.

Paul Sturrock

Are you using a transaction for reads? Do you comit these?


Yes i do transactions for read.No i didn't commit.

Sameera
I write db transaction application with using frameworks struts and hibernate.

I have problem when did the any transaction MS SQL server keep there status "AWAITING COMMAND".i got these DB status using "SP_WHO" command.so this issue can be raise memory problem.because my application gets more memory then gives
out of memory exception this application deploy on tomcat.

please give me advices to solve these problems

Thanks
Sameera
I got solution.I modify my code with above code line and assign value to inside the WorkSheet(WorkSheet obj) constructor now is work fine.

works = new WorkSheet( it.next());

Thanks for All

You can't close the Session if you are using it.



Yes i know that. I mean after when i put all the objects in to vector returns by hibernate query.
i want close the session.If not how can i close that hibernate session?

It means your Vector wil only ever have one entry.


I cant understand what was told in above sentence.

Is this what you want?


I want close hibernate session when i open before i leave that code block to save memory

I use vector for store object.I can understand exception before you said like this.

Assuming its a Hibernate Session, closing the session will not empty the collection.

This exception throw when i closed method i finally found.

No there is no any exception occur


sorry for before i said no any exception raised.


org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:60)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:140)
at opro.worksheet.WorkSheet$$EnhancerByCGLIB$$5d8fdae2.getBugNumber(<generated>)
at opro.worksheet.WorkSummery.doTag(WorkSummery.java:25)
at org.apache.jsp.Worksheet_jsp._jspService(Worksheet_jsp.java:739)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
No any special reason i just declare work out side the method.Is there any problem?