Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Concurrent updates/deletes

 
forums UseR
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,

I have developed a JDBC frontend UI to MS SQL backend. I am not using any synchronized code anywhere. I am now concerned about multiple session trying to deal with same rows. I am not even using "Transaction code" (to be honest, I have no idea how to do transaction coding using JDBC).

Any thoughts/ideas/solutions are appreciated.

Thanks

Srinivas
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Srinivas,
You are going to have to elaborate to get a useful answer. What are the users doing? What is the scnario you are tyring to prevent?
 
forums UseR
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Srinivas,
You are going to have to elaborate to get a useful answer. What are the users doing? What is the scnario you are tyring to prevent?


Hi Jeanne,

Thanks for your response...

I have developed a Course Registrations web application.

Users:
1. Users can check course schedules on the home screen.
2. They can either register for a course/un-register for a course.

Admins:
1. Admins can create/change/delete courses
2. Create/change/delete course schedules.

Now there are various activities that can occur concurrently...

1. what if the user is trying to register and at the same time, the admin has just finished changing the course schedule!!!

The user still thinks that he's registered for old course schedule..., unless he notices the new schedule and then un-register for the new schedule (if that day/time does not work for him).

2. Two admins are trying to edit the course/course schedule at the same time ? That is, working on the same back end table row..., I haven't used any technique to address these scenarios. I am using just pain old JDBC.

Any thoughts/ideas/solutions are appreciated...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Transaction code would help you with the 2 admins at the same time. For the student/admin, it sounds like they would be operating on different data and you would need to write something yourself to handle it.
 
forums UseR
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Transaction code would help you with the 2 admins at the same time. For the student/admin, it sounds like they would be operating on different data and you would need to write something yourself to handle it.


I am noob to Transaction code in JDBC. Can you please give sample code/tutorial links on how to write Transaction code ?

The application I am working involves multiple queries for user action. For instance, if admin changes the start date for a course, I have to execute 3 queries in the back end for the changes to update.

Thanks

Srinivas
 
Jan Cumps
Bartender
Posts: 2586
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srinivas chary wrote:...I am noob to Transaction code in JDBC. Can you please give sample code/tutorial links on how to write Transaction code ?
...
Here's SUNs tutorial: Using Transactions (The Java™ Tutorials > JDBC(TM) Database Access > JDBC Basics)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic