Hi,

I'm not sure the title of this question is really clear. So I explain:

I've a Postgresql DB configured this way :


  | <datasources>
  |   <local-tx-datasource>
  |     <jndi-name>xxxDS</jndi-name>
  |     <connection-url>jdbc:postgresql://xxx:5432/xxx</connection-url>
  |     <driver-class>org.postgresql.Driver</driver-class>
  |     <user-name>xxx</user-name>
  |     <password>xxx</password>
  |   </local-tx-datasource>
  | </datasources>
  | 

In my application, I do the following :

    1 : get a connection from datasource (xxxDS)
    2 : insert some data in the database
    3 : put a message in a queue
    4 : release the connection

Then another application do the following :

    5 : get the message from the queue (MDB)
    6 : get a connection from datasource (xxxDS)
    7 : call a stored procedure in the database
    8 : get the results
    9 : release the connection
    10 : etc...


My problem is that I get an error 50% of the time. 
It is due to :
    the stored procedure does not find the data which should have just been inserted.

So, I conclude that it is a problem of transaction. The first connection has not yet 
commited while the second is already performing.

Am I right with this conclusion?
What should I do then to get it work? 
Maybe, I should force the commit but how (commit() is forbidden : "You cannot commit 
during a managed transaction!")?

Thanks a lot!

JR

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

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


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to