• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Concurrent updates/deletes

 
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
 
author & internet detective
Posts: 40211
816
Eclipse IDE VI Editor Java
  • 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
Posts: 40211
816
Eclipse IDE VI Editor Java
  • 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
 
Bartender
Posts: 2658
19
Netbeans IDE C++ Linux
  • 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)
 
Hang a left on main. Then read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic