-->
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.  [ 4 posts ] 
Author Message
 Post subject: EJB
PostPosted: Tue Nov 04, 2003 4:51 am 
Newbie

Joined: Tue Nov 04, 2003 4:48 am
Posts: 1
I have got importnat questions to decide how to design my web application.

One of then is that I need clear arguments what are the advantages or disadvantages of using EJB over simple JDBC wrapper.
I mean wrapper is like a tool that has a highest class that stands over table in database. You call it O-R table-per-class-hierarchy.
I like this method and i have used it with no problems with a specific web application, but as far as i read about EJB i think more about caching.

For example I have a class Customer with methods
load();
create();
save();
delete();
get__();
set__()
Customer has an encapsulated instance of class TCustomer, that represents the table "customer" in database. Actually TCustomer is a couple of vectors with column values, and TCustomer provides methods to select, update insert and delete of each row. Note, that only those rows of table "customer" are stored in TCustomer members, that are really needed by Customer object. That means table could be opened only with some filter clause "Where ".

So the picture is like this

Database Table or View <==JDBC===> Table---->TCustomer--->Customer

I think it is clear what jdbc wrapper am i using.

I want to know why EJB is better if it really is.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2003 9:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
EJB (assuming SLSBs) allow CMT and remoting interface. Transaction librarys such as Spring give you most of the benenfits without the overhead of the container. There are quite a few examples using just a serlet container so check them out. Unless you need clustering and all the stuff then you don't need EJB.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2003 9:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Note that even if you do need clustering you probably don't need EJB. However, if you need a clustered cache - for example the new Hibernate 2.1 support for clustered caches, you do at least need JTA, which probably implies session beans.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2003 3:28 pm 
Senior
Senior

Joined: Wed Aug 27, 2003 6:04 am
Posts: 161
Location: Linz, Austria
gavin wrote:
Note that even if you do need clustering you probably don't need EJB. However, if you need a clustered cache - for example the new Hibernate 2.1 support for clustered caches, you do at least need JTA, which probably implies session beans.


After all, EJB CMT just delegates to the JTA subsystem of the respective J2EE container. So even if you need to work with JTA for whatever reason, you should be able to use programmatic demarcation via plain JTA - or preferably the Spring Framework's transaction management with JtaTransactionManager as strategy, for more convenient demarcation means and more reusable business object implementations.

Juergen
(Spring Framework developer)


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