Handle version in JPAContainer

Hello,

As SQLContainer includes version control in TableQuery:
TableQuery q1 = new TableQuery(“personaddress”, connectionPool);
q1.setVersionColumn(“VERSION”);
personContainer = new SQLContainer(q1);
My question is whether JPAContainer will consider the feature as an enhancement late. Or who can give me any advise?

Thanks,
Watt

Hi,

I assume you’d like to have some kind of optimistic locking support? Have you tried the @Version annotation? I think that should work fine. To work clean with that you might also want to use e.g. buffering in your form and possibly also set writeThrough to false at the item level and then commit changes in one transaction.

cheers,
matti

Thank you, Matti! You remind me the usage of the @Version annotation.