Forums Register Login

EJB entity bean or JDBC?

+Pie Number of slices to send: Send
I am working on my graduation project proposal.

I talked about this with a friend of mine who works in the IT industry.

He said that access to database by EJB entity bean can be very slow, and JDBC performs much better. He says that's why his company does not use EJB at all, they use JDBC to access database. And he also mentioned that they selected JDBC because it supports multithread better and that there will be some multithread problems if we use EJB entity bean.

He said we have a pet store demo application from java.sun.com, which I think most of you know.

So he said that I can run the original pet store demo application, test its performance, record the data, and then change that version of the application by replacing the EJB stuffs there, and run the latter, test its performance, record the data, and then I can make a good comparison between the 2 versions and may get a conclusion such as "EJB entity bean access of database is slower than JDBC".

What do you people think? Is this feasible? And is it optimistic that I'll get anything from such a comparison?

If your answer is yes, I'll start to work on it. At this moment, I think it's interesting.

Thanks a lot.
+Pie Number of slices to send: Send
Your friend is right.
Go ahead. But JDBC where? In the session bean?Which session bean statefull or stateless?
Or is it going to be a BMP entity bean..pls be clear about this!!!
+Pie Number of slices to send: Send
Yes, your friend is correct. Just using JDBC over an EJB is much quicker. This is because EJBs whose persistence layer is a database generally use JDBC to communicate with the database. Thus using JDBC within an EJB (and calling the EJB from a client application) must be slower than just using JDBC (from a client application). However, EJB's are not about database access, they are about distribution, scalability and flexibility. The problem JDBC solves is "how do I access a database?" the problem EJB solves is "how do i distribute my application over multiple servers" or "how can i ensure my components are transaction aware", that sort of thing...
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 830 times.
Similar Threads
My SCEA Part 1Study Notes
long post IBM.158
EJB entity bean or JDBC?
CMP persistence questions
EJB and JDBC in SessionBean
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:32:13.