Link to home
Start Free TrialLog in
Avatar of dhuma
dhuma

asked on

Update counter in a table from Hibernate

we have a requirement to increment a counter in the database tables from a java program. There can be multiple java processes incrementing the counter. How can we make sure that the counter is incremented correctly, so that there are no dirty reads by the processes and increment on a stale value.

using Hibermate mapping to that table.

Note: this is not the ID column.
ASKER CERTIFIED SOLUTION
Avatar of Sharon Seth
Sharon Seth
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dhuma
dhuma

ASKER

this is the counter we use on how many messages were processed by the client programs.
Avatar of dhuma

ASKER

is there a way to acheieve this from hibernate ?
Avatar of dhuma

ASKER

.