By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,650 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,650 IT Pros & Developers. It's quick & easy.

Java where facing some rare situation

P: 5
When i changing database data directly,ie.,manually i am doing insert or update statement database
that time i forget to do commit it in database.
same time i run my java application that time it should not update,coding is still running.

again go and commit it. that time my application is run
what happenned?

what is reason for that.can anyone tell me?
Sep 12 '12 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 785
That's a database question, not a Java question. You should move that to the correct forum.

Answer:
As long as you don't commit, the changes are not visible to other processes. So your manual changes are done in one process and your program is running in another process.

Also, the old values you have read and stored in java variables are not automatically updated. For example if your program reads a record with employee name = "oldMax", then you update this record manually to employee name = "newMax" and commit, and then your program continues to save the whole (!) record (and not only the changed part, for example the employee address), then you overwrite your changes and the employee name of the record is reverted back to "oldMax".
Sep 12 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.