Sign in to follow this  
harryben

Sql+Socket = How to Design ?

Recommended Posts

Hello there, New to the forum. Can u advise on the following please ? I have developped a software which manage different kind of media through a library tree and through playlist. These playlists are set for a group which contain users. So all the users of the group can retrieve the same playlist and thus also the same media. Those users are in fact "the player" part of the software which just retrieve the playlist and media and play them back. Now for some reasons i ve migrated the databse from access to sql; especially to enable multiuser. -------------------Now the Intro of the Question-------------- i d like multiple admin to access the group management and thus the possibility of modyfying the media in the playlist for each groups. Now what happen if admin1 is accessing the group and in this group he is editing one media from the playlist to modify some properties...and at the same time admin2 is accessing this same media (in read only of course) and while admin2 is looking at the property...admin1 is deleting this media... -------------------Now the Real question---------------------- I d like to use sockets to enable all admin "talk" to each other on what they are doing on the database...however i d like to know how the databse should notify the "socket" that something happened ??? thanks for helping on that topic.

Share this post


Link to post
Share on other sites
Quote:
Original post by harryben
Hello there,
New to the forum.
Can u advise on the following please ?
I have developped a software which manage different kind of media through a library tree and through playlist.
These playlists are set for a group which contain users. So all the users of the group can retrieve the same playlist and thus also the same media.
Those users are in fact "the player" part of the software which just retrieve the playlist and media and play them back.
Now for some reasons i ve migrated the databse from access to sql; especially to enable multiuser.
-------------------Now the Intro of the Question--------------
i d like multiple admin to access the group management and thus the possibility of modyfying the media in the playlist for each groups.
Now what happen if admin1 is accessing the group and in this group he is editing one media from the playlist to modify some properties...and at the same time admin2 is accessing this same media (in read only of course) and while admin2 is looking at the property...admin1 is deleting this media...
-------------------Now the Real question----------------------
I d like to use sockets to enable all admin "talk" to each other on what they are doing on the database...however i d like to know how the databse should notify the "socket" that something happened ???
thanks for helping on that topic.


You can limit the problem by using transactions if your database engine supports it: during a transactions, changes to the databases are not commited. When the transaction ends, the changes are commited in an atomic way (meaning that nobody can access the change before it is completely done).

One way to emulate this on a trasactionless server is to use a flag in the database : whenever the flag is set, nobody but the flag setter can read/modify the flagged data. This is, of course, not as secure as transactions.

Now, to answer your specific question, it is up to your program to send the notifications. Ultimately, you are the one who knows everything about the database state. Moreover, the database has no way to use user created sockets to notify anyone that something happened.

Regards,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this