pros/cons jdbc hibernate ejb

4
Pros/Cons JDBC Hibernate EJB 3.0 www.rajkrrsingh.blogspot.c

Upload: rajkumar-singh

Post on 26-May-2015

3.031 views

Category:

Education


1 download

DESCRIPTION

differences bw JDBC, HIBERNATE, EJB and final conclusion

TRANSCRIPT

Page 1: Pros/Cons JDBC HIBERNATE EJB

Pros/Cons JDBC Hibernate EJB 3.0

www.rajkrrsingh.blogspot.com

Page 2: Pros/Cons JDBC HIBERNATE EJB

www.rajkrrsingh.blogspot.com

JDBC Hibernate EJB 3.0

You have complete controlover the persistence because this is the building blocks of nearly all other persistence technologies in Java.Can call Stored Procedures.Can manipulate relatively large data sets.

Simple to write CRUD (create, retrieve, update, delete) operations.No container or application server is required and can be plugged into an existing container.Tools are available to simplifymapping relational data to objects and quick to develop

A lot less artifacts than EJB2. x. Make use of annotations or attributes based programming.Narrows the gap between EJB2. x and O/R mapping.Do support OO concepts like inheritance.

Pros

Page 3: Pros/Cons JDBC HIBERNATE EJB

www.rajkrrsingh.blogspot.com

JDBC Hibernate EJB 3.0You will have to write a lot of code to perform a little.Easy to make mistakes in properly managing connections and can cause out of cursors issues.Harder to maintain because changes in schemas can cause lot of changes to your code.Records need to be locked manually (e.g. select for update).

Little or no capabilities for remote access and distributability.Mapping schemas can betedious and O/R mappinghas its tricks like using lazyinitialization, eager loadingetc. What works for one may not work for another.Limited clustering capabilities.Large data sets can still cause memory issues.Support for security at a database level only and no support for role based security without any add on APIs like Aspect Oriented Programming etc.

Since it is new, might be too early to use in commercial projects.It is still evolving.

Cons

Page 4: Pros/Cons JDBC HIBERNATE EJB

www.rajkrrsingh.blogspot.com

JDBC Hibernate EJB 3.0

Where possible stay awayfrom using JDBC unless youhave compelling reason touse it for batch jobs wherelarge amount of data need to be transferred, records in use greater than 5000, required to use Stored Procedures etc.

Suitable for records in usebetween 100 and 5000. Watch out for memory issues, whenusing large data sets.

As a rule of thumb, suitable for distributed and clustered applications, which is heavily transaction based. Records inuse say between 1 and 100.

Conclusions