Update Entities Data with API

Update Entities Data with API

  

I have some entities in my database. One of them is Profile entity. So, if sometimes profile entity must be updated, what i need to advanced sql with function update ? or just make in the API like this ?

Thanks for your answer.

yes, you can use that entity action, no need for advanced sql.

regards,

bb

Barong Bali wrote:

yes, you can use that entity action, no need for advanced sql.

regards,

bb


Hi Barong Bali,

Thank for you answer. But, if i have been updated the data, did the data successfully get in on the database ?


yes, it will be commited, unless there is an exception thrown, the transaction will be rollback.

regrads,

bb

Barong Bali wrote:

yes, it will be commited, unless there is an exception thrown, the transaction will be rollback.

regrads,

bb


hi Barong Bali,

how about this ? can u expalin to me simply ?

Sure,

The First one.. Create orUpdatePosting- it will create a new records, just in case the primary key is not exists (if there is no same ID attribute), and will update the old record if there is the same ID (key).

The second one... GetPostingForUpdate.. it will lock a record you are going to update such that no one else can update it until you release the lock (by commit action, for example).

regards,

bb

Hi Fahmi,

The "GetXxxForUpdate" will fetch the current record and lock it. See here for more info*. You typically don't need to use that, unless you are in a high transaction environment where there's a big chance your data is being changed and you need to handle that.

*It's for 9.0, since I couldn't quickly find the P10 page, but it's still valid with regards to the behaviour.

Thanks guys it refreshed my knowledge about GetXXXForUpdate.