This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes Beginner Spring with Hibernate integrated. Is this code correct? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Beginner Spring with Hibernate integrated. Is this code correct?" Watch "Beginner Spring with Hibernate integrated. Is this code correct?" New topic

Beginner Spring with Hibernate integrated. Is this code correct?

Khosrow Moossavi

Joined: Aug 08, 2005
Posts: 26
Hello Ranchers,

I've recently start to learn and integrate Spring and Hibernate to my Java web app (Struts2 as a presentation). I've googled a lot about tutorial and examples and so on. Well, everything seems ok and running based on the materials I've collected. but as long as I've deployed it on a hosting web server and got a Lot of Runtime java.lang.OutOfMemoryError exception, I wanted to clear things up to myself that everything I'm doing is correct as point of view of an expert, then assuming there are some issues about my Webserver Hosting or something else.
So here the Code:







I'd really appreciate if anyone could help me whether I was on a right path or something seems wrong or Exception-Throwing-Material on the above application development.


SCJP and SCWCD are going to be installed here.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

Actually it looks really clean to me.

There are a few suggestions, but for just starting out, they are really minor. Things you will learn as you learn more about Spring, like autowiring, And if you use recent Hibernate versions using the HibernateTemplate and HibernateDaoSupport is now antiquated. The reason why I say the last, is now you have a class that is coupled with a Spring class, the HibernateDaoSupport, so your Daos are no longer POJOs. Later, you might also like the Annotation route.

But again for a beginner that is great looking configuration and coding.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Beginner Spring with Hibernate integrated. Is this code correct?
Similar Threads
Hibernate with Spring does not commit Data
Hibernate with Spring
I am getting org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity:
Java app on Tomcat return "Network Error (tcp_error)" error
running before I can crawl ( or how to add Spring to an existing Hibernate standalone app)