my dog learned polymorphism
The moose likes JBoss/WildFly and the fly likes multithreaded and transactional EJB System Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Reply locked New topic

multithreaded and transactional EJB System

Rodrigo Bossini
Ranch Hand

Joined: Jul 03, 2009
Posts: 113
Hi guys,

I'm just starting to study EJB, by reading the Enterprise JavaBeans 3.0 book.

Actually, I'm doing this because in the near future I plan to use this technology in my company.

Today, we have an application that accesses N FTP servers and downloads files for the N corresponding local directories. It does uploads as well. Each of the FTP servers belongs to one specific client of our company. Therefore, the app must be multithreaded. And it is. It manages multiple threads, one for each of the ftp servers it has to access. We are using the Apache FTP API for the FTP operations.

So here's my question:

- If I were to develop this application using EJB, one of the benefits it would provide me with is the multithreaded management?

Say, the code from the run methods from the threads of my application today would be passed to the EJB, which would run and manage one thread for each of the FTP configurations that I pass on to it?

Another thing:

- I'd like it to be a transactional system. All of the downloads and uploads are registered in a database. And right after it has abeen registered, the downloaded file is deleted from the FTP server from which it was downloaded. I'd like the file to only be deleted if it had really been downloaded and registered in the database. I believe it is a transactional behavior, right?
Today, if some exception occurs, it might happen that the file was downloaded and registered in the database, but never deleted from the FTP server. Would EJB grant me this too?

And another thing:

In a few weeks I'll need to develop a system that is specialized in sending and downloading emails. Like this FTP service I mentioned above, it will have to be a multhreaded system as well. Would it be recommendable to develop such a system by using EJB technology?

Thank you.

I see wind mills
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Please don't post the same question in more than one forum.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: multithreaded and transactional EJB System
It's not a secret anymore!