This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Shall I Use EJB or Java Interfaces

 
kishore routhu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are working for a project which is developed using Servlets,
Stateless EJB and Hibernate. Basic HTTPServlet will receive request
data from client and it delegates processing job to respective
stateless EJB. The request message is an XML string(some times size >
5 KB). DAO layer using Hibernate will take care of accessing database.
There are some handler, utility classes which have calls from EJBs.
According to our business logic, No need of maintaining transactions
and security at EJB layer. Application is running in Jboss App server.
We are using mysql data source manged by Jboss and accessing from
Hibernate DAO layer

My Question is: In this case, Should I use Stateless EJB or Shall I go
with normal java interfaces ?
What is the necessity of EJB layer here ?
 
Viktor Pergjoka
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you go with interfaces and when you think they fit better as EJBs you can transform them to EJB(vers 3+) with no so much effort.
 
VenuGopal Thati
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Other option would be directly use EJB3, You will not have to spend lot of time on coding. If you have to use transactions and security in future there will not be any need to refactor your code.
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not understand your desing. You have wtitten that you do not need any transactions. So you have thread local Hibernate sessions that are not associated with JPA transactions?
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic