This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Adding new Callback method to MDB Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "Adding new Callback method to MDB" Watch "Adding new Callback method to MDB" New topic
Author

Adding new Callback method to MDB

amar nath jha
Ranch Hand

Joined: Mar 09, 2006
Posts: 42
Hi All

I am new to EJB .I am stuck in a scenario. I am explaining the scenario below :

We have a very big resultset having nearly 1027826 records. And we have to process all the records.After processing the records we have to update the status in the database table against the records.And we have to update another table with the status that all the records under this Id have been processesed. So we will have two tables first one Master table having Id and status and second one Chile table having all the child records against the id from the master table.Now if some thing fails then we have to reprocess entire records again.


My approach is to read all the records from database .Iterate over the resultset .Create group of records on the basis of some common fields and then we will pass the groups in form of message to a Message Drive Bean for processging.Our main thread will keep on waiting till all the groups have been processed .Once processing is done we will update the database record. Now to update the master table we have to first confirm that all the child records have been processed i.e 1027826 records .


For this can we have a callback method that our JMS will invoke so that we can notify the main thread(waiting thread) that all the records has been updated.We can put some logic there that all the records have been updated and then we will update master table.

My query is can we add our own callback method with MDB and how to do it.

Thanks
Amar


Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8436

This question has nothing to do with Swing. Please take some efforts while posting to ensure you post in the proper forum.
http://faq.javaranch.com/java/CarefullyChooseOneForum


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
amar nath jha
Ranch Hand

Joined: Mar 09, 2006
Posts: 42
Ohh I am sorry I posted it in swing forum will take care of this in future
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Adding new Callback method to MDB
 
Similar Threads
Locking Schemes: Tactical View 01
Process completes and abruptly stops its threads?
JMS message issue
Need a best messaging Solution
When commit transaction