This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Help about field Value Reset to 0 ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Help about field Value Reset to 0 ?" Watch "Help about field Value Reset to 0 ?" New topic

Help about field Value Reset to 0 ?

Rahul Nair
Ranch Hand

Joined: Dec 01, 2007
Posts: 138
I have a demo application in which there is a link..If user Clicks on that link i increment the counter in my database table.The counter field has type bigint. After trial run ...When i see the counter value in the database then it is Reseted to 2...After trial run it has value 250 but it Shows counter now 2 why this is happen ??? is there any problem of Concurrency ??

Please Help me ..

[ March 25, 2008: Message edited by: Rahul Nair ]
Pratap koritala
Ranch Hand

Joined: Sep 27, 2006
Posts: 252
It depends on your code.....
But one thing seems very obvious..

you might have done something like you intialized the variable , started incrementing that and putting in database.So, the problem is when the Servlet reloads that variable might be again setted to its intial value.

I assumed this problem depending upon your Query.
It is sorta covered in the JavaRanch Style Guide.
subject: Help about field Value Reset to 0 ?
Similar Threads
Single row/column database table to hold an auto-incremented counter with Hibernate?
Not Able to load class with long name and having 2 $ signs in jnlp
Forwarding control from Servlet to JSP
how to generate field dynamically in wicket