• Post Reply Bookmark Topic Watch Topic
  • New Topic

What transaction Attribute to use

 
kalpana Kumar
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

We have a requirement where a backend job starts and calls the SSB via a webservice and places the messages in the queue. This backend job would run every 5 minutes and we have to make sure that the same message is not picked up twice.

The SSB which puts the message into the queue has a transaction attribute of Required.
To accomplish the above we are planning to set a flag in the database against each message after the message is put in the arraylist within the SSB.

Since lot of XML parsing is involved internally, the time taken to process 1000 messages is 20 minutes. So, here are my doubts. To accomplish the above

1. Since the entire process takes 20 minutes and the backend job runs every 5 minutes there is a high probability that the same record could be picked up.
2. So, Can I define one more method in SSB and do a updation in the database by setting the flag against each messages that was selected? and make this method not a part of the actual transaction by setting the transaction attribute to be NotSupported.

Or is there a different way to do do.

Please any suggestions is appreciated.
 
Mark Spritzler
ranger
Sheriff
Posts: 17290
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so if the update of the database of all the records selected is not part of the transaction, and the first method which is the 20 minute process fails and rolls back, you would need to change those records back to not being selected.

But if you keep that second method in the first's transaction, then other clients won't see that you have selected them.

I would definitely look at the process that takes 20 minutes to reduce that time, or change your others interval to be over that time. But later if your system is bogged down, that process might take more than 20 minutes to complete and then your interval is too small again.

I definitely think the approach to the process and what needs to be done is in order. I just can't think of a great solution for you at the top of my head right now. Sorry.

Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!