aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Some JBoss questions - from interview yesterday - proxys, nature of J2EE, hibernate collections, ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Some JBoss questions - from interview yesterday - proxys, nature of J2EE, hibernate collections, ..." Watch "Some JBoss questions - from interview yesterday - proxys, nature of J2EE, hibernate collections, ..." New topic
Author

Some JBoss questions - from interview yesterday - proxys, nature of J2EE, hibernate collections, ...

K J Smith
Greenhorn

Joined: Jun 28, 2012
Posts: 4
Hi All,
I had a weird interview yeserday - where a JBoss / Java Architect had ideas and comments that threw me a bit.
He made the following 5 statements (which he insisted were true - and i am doubtful - but i'm only a newbie) ...

Can I have any comments from users? - that is - correct or not - and why?

1: It is common to transfer *raw* hibernate proxy objects (typed as Object) to a web-based ui (rather than entities proper or some form of transfer object).
In cases where more information is required (eg. a lazily fetched collection) the proxy object can then be transferred back to the sever and reinitialized/reattched.

{In response to Jaikiran Pai: I tried processing hibernate proxys in a client on the way home - and i found there was difficulty in serializing proxys, the type-safe nature of java is subverted, the 'type' corresponding to the proxy seems to be generated at runtime by the server (by byte code editing?), the only way to access data seems to be reflection, the code i wrote needed to be tied to the particular version of JBoss (working a bit on JBoss 4, wouldn't even compile on Jboss 5) ... and i can't think of a way to reattach a proxy.
The question.... Are these problems real - or am i just a bit slow witted?}

2: It is better to work with the raw hibernate collections in a stateless ejb as opposed to the standard java collections.
{In response to Jaikiran Pai: by raw hibernate collection i mean the collections used internally by hibrenate - the unusual one being 'bag' - i think this is very tight coupling between systems that should be unaware of each other?}

3: The *only* feature of J2EE is the persistence/Entity layer.

4. JMS is not a valid way to decouple information from stateless beans when starting long (many minutes) running process
{In response to Jaikiran Pai: They were using JBoss 4.2 and so only EJB3.0}

5. Container managed transactions are an inherent part of the persistence/Entity layer - rather than, for example stateless, beans.
It is not possible to mix container managed and non-container managed transactions in a single jboss application

Thanks

kjs
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9340
    
110

K J Smith wrote:

1: It is common to transfer *raw* proxy objects (typed as Object) to a web-based ui (rather than entities proper or some form of transfer object).
In cases where more information is required (eg. a lazily fetched collection) the proxy object can then be transferred back to the sever and reinitialized/reattched.

What's the question here?

K J Smith wrote:
2: It is better to work with the raw hibernate collections in a stateless ejb as opposed to the standard java collections.

What's a raw hibernate collection?

K J Smith wrote:
3: The *only* feature of J2EE is the persistence/Entity layer.

If that was the case then there wouldn't be so many users complaining that Java EE (that's what it is called now) is so vast. I don't know if the interviewer asked that as a question to you or whether he/she was making a statement.

K J Smith wrote:
4. JMS is not a valid way to decouple information from stateless beans when starting long (many minutes) running process

EJB 3.1 has asynchronous invocations feature

K J Smith wrote:
5. Container managed transactions are an inherent part of the persistence/Entity layer - rather than, for example stateless, beans.

Again I don't know whether this was asked as a question or whether this was a statement. Anyway, EJBs inherently are transactional - doesn't matter if you use persistence or not.

K J Smith wrote:
It is not possible to mix container managed and non-container managed transactions in a single jboss application

Wrong again. The granularity of type of transaction is per bean level (for EJBs). A single application can have a FooBean with container managed transactions and a BarBean with Bean managed transactions.

By the way, none of this has anything to do with JBoss and it's more of Java EE. So I'll move this to an appropriate forum.

[My Blog] [JavaRanch Journal]
K J Smith
Greenhorn

Joined: Jun 28, 2012
Posts: 4
Jaikiran Pai wrote:
K J Smith wrote:

Thanks for your reply - i have edited the original question to make things clearer.

kjs
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Some JBoss questions - from interview yesterday - proxys, nature of J2EE, hibernate collections, ...
 
Similar Threads
Mock Exam Questions
Doubt in stateful session bean
Difference between Application Server and Web Server
Use DAO or not? in JDO
Java Beans VS Data Transfer Objects