View previous topic :: View next topic |
Author |
Message |
Ephasme
Joined: 24 Aug 2010 Posts: 7
|
Posted: Tue Aug 24, 2010 15:37 Post subject: Concurrence with MySQL |
|
|
Hello again..
First, sorry for my english because I'm French. I'm scripter on FastFrench (french server) and I'm recoding totally my module. So I come here to ask you a question about concurrency in MySQL.
The situation : I use the function SQLExecDirect(sQuery) and after, the script SQLFetch() and again after SQLGetData(1) in a event script.
When a Client is entering into the mod, all theses function fires but, what happens if two client enter into the mod simultaneously ?
I mean :
Player A enter into the mod, the event OnClientEnter fires and the script oncliententer_script is executed.
Now, precisely when the SQLExecDirect() function is done, the seconde player log in and fires OnClientEnter and executes oncliententer_script.
So SQLExecDirect() is executed twice, so Player A's datas must become the same as Players B's datas.
A Schema :
Code: |
1. Player A Enter
2. SQLExecDirect 2. Player B Enter
3. SQLFetch 3. SQLExecDirect
4. SQLGetData 4. SQLFetch
|
Problem...
How to solve this ? Can I make a Semaphore in NWNScript or NWNX takes care of that ? |
|
Back to top |
|
|
Zebranky
Joined: 04 Jun 2006 Posts: 415
|
Posted: Tue Aug 24, 2010 16:41 Post subject: |
|
|
Two scripts will never execute simultaneously, and the nwnx_odbc calls are synchronous, so you don't need to worry about it at all. Player A's OnClientEnter will finish before Player B's begins. _________________ Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/
<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.
<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for? |
|
Back to top |
|
|
Ephasme
Joined: 24 Aug 2010 Posts: 7
|
Posted: Tue Aug 24, 2010 20:56 Post subject: |
|
|
Thank you very much ! I prefer that. |
|
Back to top |
|
|
|