I'm running jboss 3.2.6 and am attempting to send a single jms message based on 
a transaction commit.  Our system currently employs an ODBMS and we have change 
events being fired from the persistent objects.  Within the coarse of a single 
ejb call, multiple (and possibly a large number of) changes are possible.  I 
know that i can use java:/JmsXA to get the messages sent on the transaction 
commit, but (from the point of view of the listener who is just digesting the 
events) i'd have to queue up a message for each event that my listener 
receives.  I'm thinking it would be better for my listener to queue up the 
events based on the particular transaction and send a single message containing 
those events upon a commit.  So far, I have attempted to implement this by:

1.  Upon receipt of the event, look up the transaction manager and grab the 
current transaction
2.  associate (at first time) a Synchronization with the current transaction
3.  continue to register all events for that given transaction
4.  upon commit, the Synchronization get's a call to afterCompletion() and if 
STATUS_COMMITTED, publish a single message containing all the event data

As i know that i'm outside the scope of a transaction at this point, I'm 
creating a TopicSession (via java:/JmsXA) with transacted = false, but i'm 
getting:

javax.jms.IllegalStateException: The session is closed

when attempting to publish (and other various related messages about 
connections being closed for me by the CachedConnectionManager and prepare 
being called on a local tx).

At this point I'm trying to figure out, is using the Synchronization in this 
way an OK thing to do.  If so, how can i send a simple jms message in this way?

Thanks

Scott

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3866982#3866982

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3866982


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to