Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all!
Is it possible to do the following: Several users are logged in to a web site, one of the users saves/submits information in a database, all logged in users' sessions are updated.
I'm thinking something in the line of using triggers or stored procedures (executing other script?). The environment at the moment are (not fixed, I can change) MySQL 4.0.16, PHP 4.3.4 and Apache 2.0.48 on a Gentoo Linux-box.
I appreciate any input on this =)
With regards
//Jonas

That's interesting, you have the same software setup that I have. Gentoo is pretty
stable... What window manager are you running?Concurrent usage of a database may have a built-in system of checks and balances, if previously defined or set by default. If one user has accessed a record, you can have it locked, to where no one else can grab it. Once that user completes their process, you can submit your changes to a secondary script that will write out the updates to the users that are logged in, at a given interval. However, you have to accomodate the users that may try to access the record prior to the update of the session. You can either make that process wait a few moments until the bulk-session-update takes place, or try to find the record you are trying to access in the file that is going to be processed at the given update interval first. If the record exists in the bulk update file, use the contents there... otherwise, go out to the database to pull the information as you normalyl would.
In short, the answer to your question. It is
possible. You just have to determine if you are wanting to take a bit of a hit on processing time.If concurrent interaction is excessive to where your database is interactive with various users 24/7... then you may want to look into locks for the records or more detailed, complex triggers.
IR

Hi there IR!
I got a hold of the entire article abstracted on http://www.dke.jku.at/smwp/abstract_smwp-theory2practice.html
Together with your reply I think I have a pretty good idea of what is needed to be done, but do you know of an web pages that has examples of this approach?
with regards
//J

Here are a few links... that outline some concepts...
http://mckoi.com/database/Transactions.html
http://www.polyhedra.com/concur.htm
http://www.ti5.tu-harburg.de/Lecture/97-98WS/Transaction/CContr2/Go to google and look for 'database concurrency' or a derivative of that... There are several examples out and about. I would suggest looking into record locks and such, or a bulk update method.
IR

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |