• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Hibernate from Stateless Session Bean

 
satheesh krishnaswamy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anyone let me know how to call a Hibernate from a Stateless Session Bean?

Thanks in advance.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain what you mean by "call a Hibernate".
 
satheesh krishnaswamy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the stateless session bean which is exposed as web servcies, I want to call hibernate util class which is meant for persistence.

How should I do that?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just as you would any other Java class. The Hibernate documentation covers how to do that. Is there something more specific you don't understand?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's really no mystery here. You do it the same way in an EJB as you would in a standalone Java application.

If the Hibernate libraries are available to your EJB component, you just call on the Hibernate Session and associate the POJO with your session. It's that easy.

Maybe you really just need an introduction on how to use Hibernate. I've got some good tutorials to get you started. Check them out:

How to Use Hibernate EVERYWHERE - Even in an EJB!

Best of luck! And post back with questions if you get stuck.

-Cameron McKenzie
 
satheesh krishnaswamy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.
I will surely try and get back to you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic