-->
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.  [ 7 posts ] 
Author Message
 Post subject: about Hibernate and EJB
PostPosted: Wed Oct 18, 2006 1:25 pm 
Beginner
Beginner

Joined: Thu Jun 30, 2005 4:14 pm
Posts: 25
Folks,



I read EJB entity bean specification. Looks like EJB entity bean can be called remotely with JNDI, which means Entity can be downloaded as a copy from different JVM. But seems Hibernate object can not do it.

am I right?



Thank you very much.



Chaohua


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 1:26 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
No, you are not right.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 1:40 pm 
Beginner
Beginner

Joined: Thu Jun 30, 2005 4:14 pm
Posts: 25
Could you tell me why?

or How to call a remote hibernate object?

or any link about this question?

Thanks a lot


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 1:47 pm 
Newbie

Joined: Wed Oct 18, 2006 12:30 pm
Posts: 8
chwang wrote:
Could you tell me why?

or How to call a remote hibernate object?

or any link about this question?

Thanks a lot



Chwang,

we have to distinguish between different versions of the EJB specification here:

As of the EJB 3.0 release, Entity Beans are simple POJOs. They are not intended to be called remotely. Session Beans (both stateless and stateful ones) can be called remotely however IF they have a remote business interface.

By contrast, with earlier releases of the EJB spec (e.g EJB 2.0) Entity Beans supported remote calls via IIOP.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 1:58 pm 
Beginner
Beginner

Joined: Thu Jun 30, 2005 4:14 pm
Posts: 25
Wolles,

Thank you. According to what yuo said. Ejb3.0 or Hibernate object must bind with Session bean in the same JVM, so to Manipulate Database.

Am I right?

Chwang


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 2:27 pm 
Newbie

Joined: Wed Oct 18, 2006 12:30 pm
Posts: 8
chwang wrote:
Wolles,

Thank you. According to what yuo said. Ejb3.0 or Hibernate object must bind with Session bean in the same JVM, so to Manipulate Database.

Am I right?

Chwang



Chwang,

I'm sorry, but I do not really understand your question. So it is difficult for me to give you an answer.

But back to your first post in this thread. There you wrote:

Quote:
Looks like EJB entity bean can be called remotely with JNDI, which means Entity can be downloaded as a copy from different JVM.



I think I can roughly guess what you meant. "can be called remotely" is probably the wrong wording here, creating confusion.

As I mentioned: As of EJB 3.0, Entity Beans are simple POJOs not intended to be called remotely from a different JVM. That means: They do not expose any methods intended to be called from another JVM.

But typically EJB 3.0 Entity Beans are serializable, which means that a copy of them can be passed as a parameter (function argument) of a remote method call from one JVM to another.

But note: When doing such remote calls from one JVM to another, it isn't a remote Entity which is called, but instead a method of the business interface of a remote Session bean (stateful or stateless). When doing such remote calls, Entity beans (and ordinary POJOs) can be passed as parameter (pass-by-value, so a copy of them gets passed from one JVM to another).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 4:41 pm 
Beginner
Beginner

Joined: Thu Jun 30, 2005 4:14 pm
Posts: 25
WolleS,

Thanks again. I see.

Sorry for incorrect words.

I still have 2 questions:

1.)
Quote:
When doing such remote calls, Entity beans (and ordinary POJOs) can be passed as parameter (pass-by-value, so a copy of them gets passed from one JVM to another).


I created a UserAccount entity object for a UserAccount table in server site. the client will manipulate the object.

so at the client code should have a import package for the UserAccount?

like this:

import com.bean.UserAccount.

so the client code can pass compile, but client site must donwload the obejct first, otherwise how does the client refere the object. right?

2.)
Quote:
As of the EJB 3.0 release, Entity Beans are simple POJOs


right now, Can I say the EJB 3.0 is Hibernate ? because they are all POJO. or they have different functionality?


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