-->
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.  [ 6 posts ] 
Author Message
 Post subject: using Hibernate 2 with WebSphere 5.1 and IBM Universal DB2
PostPosted: Mon Jul 26, 2004 11:54 am 
Newbie

Joined: Fri Jul 23, 2004 2:39 pm
Posts: 2
Hello all, and thank you in advance for your assistance.

I am researching alternate persistence technologies for use in our web applications. One branch of research led me to Hibernate. It sounded very promising, so I downloaded the most recent version and I am in the process of trying to integrate it into a WSAD 5.1 project. I found a few articles that sounded as though they would be helpful and forged forward.

As I worked through the examples, I found that they all referred to EJB projects (EJBs are not an option for our web applications.) Has anyone tried using Hibernate 2.x with Plain oldie Java? If so, could I get some pointers on how I would integrate Hibernate 2.x into a WSAD 5.1 Java Project? And how would one setup a data connection to UDB2?

Sorry that I did not submit the prerequisite items, but I do not think that I have gotten that far yet. If there is any other information I could submit to help you help me, please let me know as soon as possible. I only have a couple more days to look at this, before I will need to look at other technologies.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 12:55 pm 
Newbie

Joined: Tue Jun 29, 2004 12:18 pm
Posts: 5
Location: Anaheim, CA
We've used it quite successfully in a couple of projects. There isn't anything really special that you need to do, aside from reading the reference manual :-) Just make sure that your project references the Hibernate jar and all its dependencies. You can setup your configuration and mapping files however you like - just beware of the classloading issues if you're trying to use them as class resources.

What we like to do around here is create a separate project that holds all of our external, 3rd party libraries. We put all of the Hibernate-related jars in one folder. That makes it easy to associate source & docs with them. Then, to create a Hibernate-based project, just go into the Build Path and add the jars from that other project. The source attachments will follow, so debugging and code hints work well.

You also have a couple of other options when working with WebSphere applications. First, Hibernate can be built as a JCA resource adapter. I have gotten this to work with WebSphere 5.1, but it wasn't real straightforward. I can send you some notes on this process if you're interested. The other way is to directly register the SessionFactory in JNDI by specifying a name in the cfg.xml or properties file. After you build the SessionFactory the first time, it will register itself and you can look it up by name. If you're using Struts, there is even a Struts PlugIn (http://hibernate.org/105.html) so that the SessionFactory will "magically" be available in JNDI or the ServletContext after Struts finishes its configuration.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 1:25 pm 
Newbie

Joined: Fri Jul 23, 2004 2:39 pm
Posts: 2
Cybermac,
Thank you for your reply, I would not this message if I were able to make Hibernate work by following the instructions in the user manual :-0 (I think the problem is in the way WSAD places reference files.) The instructions I read refered to an EJB project (as I stated, not an option.) And STRUTS is also not an option.

If you have any documentation on how your setup a Java Project to use Hibernate, and are willing to share the knowledge, I would be greatful.

I have to research quite a few products and try to make them work in our environment (working with Torque 3.1 now), so any help you can offer will either create advocate of Hibernate or send our organization to some other product.

The instructions you listed I have already done (except using JNDI.)

Thank you for your time,


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 30, 2004 1:07 pm 
Newbie

Joined: Tue Jun 29, 2004 12:18 pm
Posts: 5
Location: Anaheim, CA
I did not intend to insinuate that you hadn't read the manual - only to emphasize its usefulness. My apologies. Perhaps I've misunderstood your question. It sounds like you want to set up a WSAD project so that you can work with Hibernate & POJO's, yes? Setting up Hibernate in WSAD should be very straightforward. As I said, your project just needs to reference hibernate2.jar and its dependent jars. The "Quickstart with Tomcat" chapter in the reference manual (http://www.hibernate.org/hib_docs/reference/en/html) has some more about dependencies. For the most part, the manual is technology-agnostic. There's nothing in there that requires you to set up EJB's.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 30, 2004 1:30 pm 
Newbie

Joined: Fri Jul 30, 2004 1:22 pm
Posts: 1
Hi,

I think the information that you are looking for is this: When using WSAD you need to import the hibernate2.jar file into the /WEB-INF/lib directory in your web project. (WSAD then updates the class path for you automatically).

You will also need to put the jar files from the hibernate distribution /lib directory into the /WEB-INF/lib directory as well.

Your hibernate.properties or hibernate.cfg.xml file needs to reside in the root of your webproject (WSAD will then automatically put the file in the /WEB-INF/classes directory).

Hope this helps.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 02, 2005 9:12 pm 
Newbie

Joined: Wed Nov 02, 2005 5:33 am
Posts: 12
Dear All,
i've successfully used Hibernate in WSAD v5.1.2 but when i deploy my application onto WAS v5.1.2, it does not work. I've followed the guideline

http://www.hibernate.org/173.html

but this does not help. I feel that it's impossible to do that because the deadline of my project will come soon. And if so, i must choose another way other than Hibernate. Thank you for your reading.

Regards,
----------------------------
thanh.hoc@gmail.com
----------------------------


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