Tasks and Servlets in Lightweight MVC Application

E

etherdonk4

I have a Java application which is currently an MVC app on Tomcat.
I've developed with Struts and in production environments before but
this project I am designing myself and I don't have much experience in
this role.

I really have little idea of how a lightweight CRUD app that runs
background tasks should be designed :). Specifically, the database
connection, the pooling, threads, thread queueing.

My application uses as JSP servlet interface to run tasks, such as
checking for email every x minutes and then sleeping y minutes, it is
all admin tasks ie meant for one user at a time running many
background threads. I'd like to code this simply.

As I understand it best practices would suggest using EJB. I've used
this before and find it a bit of a pain at development time and would
prefer to not use ejb. I want to use JSP/Servlet because it is easy
enough to create a front end button, an else/if in the servlet, and an
Action, but don't want or need a Struts framework.

Where does the database layer go? How can I manage my background
threads? Maybe it is time for me to buy a book? Right now I
instantiate sort of an application object (myApp MyApp) when the
serlvet instantiates, and pass it to the action. The Application
object has references to threads I've started which I can view, edit,
etc., but for each action I am creating a new database connection. It
just seems to get complicated when threading is involved. Any help
appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top