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

select for update by QuerySpec

Highlighted
Amethyst

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
Highlighted

Re: select for update by QuerySpec

Hello,

good question!

Try this method:

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

 

 

Highlighted

Re: select for update by QuerySpec

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