[jboss-jira] [JBoss JIRA] Commented: (JBAS-7270) MDB Transaction Batch Support
Clebert Suconic (JIRA)
jira-events at lists.jboss.org
Thu Sep 17 11:59:49 EDT 2009
[ https://jira.jboss.org/jira/browse/JBAS-7270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12486311#action_12486311 ]
Clebert Suconic commented on JBAS-7270:
---------------------------------------
+1 about the timeout. I thought the timeout was implicit defined.
> 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
More information about the jboss-jira
mailing list