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.