MDB Transaction Batch Support
-----------------------------
Key: JBAS-7270
URL:
https://jira.jboss.org/jira/browse/JBAS-7270
Project: JBoss Application Server
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: EJB3
Reporter: Clebert Suconic
Assignee: Carlo de Wolf
When someone is receiving messages, this is a pretty common useCase:
Consumer cons = sess.createConsumer(....);
Transaction tx = getTheTransactionSomehow);
int counter = 0;
Message msg = null;
try
{
do
{
msg = cons.receive(2000); // or a configured timeout
if (counter ++ == 1000) tx.commit();
performDBOperations(msg);
}
while (msg != null);
}
catch (Exception e)
{
tx.rollback();
}
However, this is not possible over MDBs. You basically have to transact every received
message.
With the code above, we would instead commit or rollback the entire group.
It should be possible to do this kind of batching with MDBs somehow.
IMO this should be suggested as part of the Specification, as other systems also have it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira