• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet session instead of EJB session bean

 
Charles Arminstice
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

So I have this very small, lightweight storefront J2EE application I created. I doubt serious 5 people will ever be on this thing at the same time, if even that many.
anyhow, I wrote it using J2EE technology, a servlet, using JPA POJOs and interacting with a stateful session bean. Everything works fine finally as far as I can tell. Here is the problem.....

Recently I learned that I would not be able to use EJBs on this project (problem with our host), but I can use servlets and jsps and the rest. So what I was going to try to do and get feedback here if this is plausible is to try to rewrite the code using JDBC calls instead of using persistence, I think I can do that, BUT I don't know if I can, maintain state in the servlet without the session bean. I can move alot of the logic over and store some things in the session parameter but I guess I need to know how would the servlet react to maintaining state info over a typical "Customer interaction" with a small storefront application, i.e. browsing, logging in, ordering, etc, would I be able to maintain state just using the servlet (called from web pages) and request parameters?

Let me know if my description was not clear.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What makes you think that you cannot use JPA without EJBs?

Just maintain state in the session like thousands of other web applications.
 
Charles Arminstice
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear, thanks.

I guess I could use JPA by itself regardless of if I use EJBs or not.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can. That would probably cause the least disruption to the existing code base.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!