Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 647
  • Last Modified:

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.
0
dhuma
Asked:
dhuma
  • 3
1 Solution
 
Sharon SethCommented:
Bad idea incrementing DB counters from client side . This should be actually done on the DB side
0
 
dhumaAuthor Commented:
this is the counter we use on how many messages were processed by the client programs.
0
 
dhumaAuthor Commented:
is there a way to acheieve this from hibernate ?
0
 
dhumaAuthor Commented:
.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now