Quantcast
Channel: Adobe Community : Popular Discussions - LiveCycle Data Services
Viewing all articles
Browse latest Browse all 58696

How to use UpdateItem() in DataServiceTransaction

$
0
0

Hello

I am using the following code to push an entry to the client and also create a new one in the database. However subsequently I want to just update the previous entry with new volume and price. So I use the updateItem() as shown below.  Please note that the entry in the database is already present, I am just updating it as part of this test..

         

        DataServiceTransaction dtx = DataServiceTransaction.begin(false); 

        dtx.setSendChangesToAdapter(true);

       

        Positions p1 = new Positions();

 

        //p1.setPositionsId(new Integer(1));

        p1.setPositionsSymbol(new String(symbol));

        p1.setPositionsVolume(new Double(volume));

        p1.setPositionsPrice(new Double(price));

        p1.setPositionsServerTimestamp(new Date()); 

       

        //dtx.createItem("WorkStation.Positions", p1); 

        dtx.updateItem("WorkStation.Positions", p1, null, null); 

        dtx.commit();

 

 

It is however throwing an exception flex.messaging.MessageException at

 

flex.data.DataService.sendBatchToAdapter(DataService.java 1630)

...

...

 

 

Any ideas whats going wrong here...

 

thanks

RK


Viewing all articles
Browse latest Browse all 58696

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>