Adrian et al.,

I'm publishing to a Topic during a transaction.  The basic gist of execution is as 
follows:

1. Client calls method on SLSB
2. Do some stuff
3. Save data to db
4. Publish JMS message to clients that data has been updated
5. Do a little cleanup
6. SLSB method returns (i.e. transaction commits).

Basically, the client is getting the JMS message that was published in step 4 and then 
immediately calls back to the server to get some data (part of which includes the data 
saved in step 3).

My problem is that when a remote VM client requests the data, the initial transaction 
apparently hasn't comitted yet, so their request doesn't produce the results they 
expect.

Apparently this happens _really_ fast (getting the message before the initial 
transaction commits).  I've found that if I delay the remove client request 1 second 
after receiving the JMS message, the data is available in the DB.

The publisher is using the UIL2XAConnectionFactory acquired from JNDI.

Since it is XA, I was hoping that the sends wouldn't happen until the transaction 
commits.  By the time the client received the message, the data _would_ be in the db, 
and the client could immediately request the data (instead of me waiting 1 second to 
do so).

I'm using JBoss 3.2.3 w/ Hibernate/Postgresql.  Is the fact that Postgres's JDBC 
driver is not XA causing me problems?

I am using the SpringFramework's transaction support to ensure that the the data isn't 
commited to the DB until the transaction commits (by using the UserTransaction in the 
SLSB).  This is working fine (i.e. data not available until transaction commits).

The message should only be published when the transaction commits.

Any ideas?

Lost,

Phar 

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

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


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to