DS sends updates to DB only in commit (can't find modified data in same TX)

Hello experts!
We have a physical data service mapping a simple Oracle database table. When we update one record in the database (invoking submit on the DS), and use a function in that same dataservice to get the refreshed record, the updated column comes with the OLD value. But after the transaction ends (we isolated this is a simple JWS), the database gets updated.
The most strange fact: we also did a test using another Data Service to do the update, now mapping a stored procedure to do the updates (without commits in body). Then the test works fine.
The conclusion I can reach is DSP is holding the instance somewhere after the submit() and is not sending it to the database connection. I understand that the commit is not performed, but if I do a query in the same TX, I should see my changed, shouldn't I?
We use WL 8.1.6 with DSP 2.5.
We´d appreciate very much if yuo guys could help.
Thanks,
Zica.

Let me get your scenario straight
client starts a transaction
client calls submit to update a data services
client calls read to re-read the update value (does not see update)
client ends the transaction
If you read now, you will see the update
And you're wondering why the first read doesn't seem the update values?
By default, ALDSP 2.5 reads are through an EJB that has trans-attrib=NotSupported - which means if you do a read within a transaction, that transaction is suspended the call is made without any transaction, then the transaction is resumed. So this is one reason you don't see the read. To do the read via an EJB method with trans-attribute=Required. See TRANSACTION SUPPORT at http://e-docs.bea.com/aldsp/docs25/javadoc/com/bea/dsp/dsmediator/client/DataServiceFactory.html
If you are using the control, the control will need to specify
@jc:LiquidData ReadTransactionAttribute="Required"
That is only part of the solution. You will also need to configure your connection pool with the property KeepXAConnTillTxComplete="true" to ensure that your read is on the same connection as your write.
<JDBCConnectionPool CapacityIncrement="2"
KeepXAConnTillTxComplete="true" />
Then I have to ask - if your client already has the modified DataObject in memory, what's the purpose of re-reading it? If all you need is a clean ChangeSummary so you can do more changes (the ChangeSummary is not cleared when you call submit), you can simply call myDataObject..getDataGraph().getChangeSummary().beginLogging()

Similar Messages

Maybe you are looking for