cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

select for update by QuerySpec

shin1h
13-Aquamarine

select for update by QuerySpec

Hi all,

I want to know how to realize the function with QuerySpec or other measure same as SQL statement of "select for update".
I found "qs.setLock(true)" api, but according to TS it is unsupported api.

 

backgound:
Target class is created with Information Modeler to manage specific list of numbers. Stored numbers on the database table need to be exclusively used with WTPart each by each. So I want to update the column which means processed flag when a record is used. I think a record should be locked when it is extracted first.

2 REPLIES 2

Hello,

good question!

Try this method:

com.ptc.core.percol.PersistedCollectionServerUtils.rowLockCollections(final WTSet holdersOrCollections)

 

 

shin1h
13-Aquamarine
(To:ivan_feofilov)

Hi fivigg,

 

Thank you for your reply.

 

Although I checked that method, it is package-private method.

Can I use it somehow?


I found below methods which are possible to be solution.
I still need to identify how would the exception ocurr if a row had been locked, though..

 

PersistenceHelper.manager.refresh(ObjectIdentifier objId, boolean lock)
or
PersistenceHelper.manager.refresh(Persistable obj, boolean fullRefresh, boolean inPlace, boolean lock)

Announcements

Top Tags