Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (PeWi, AndrewAMD, Quad, VoroneTZ), 463 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 21 of 24 1 2 19 20 21 22 23 24
Re: A7csMySql- Preliminary Testing [Re: D3D] #41817
12/12/07 01:51
12/12/07 01:51
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Thanks for the testing. Here is what we are finding out:

1) Everyone connects fine but and at some seemingly random point, the queries don't get through. All mysql dll functions return zero for their function call.

2) Another piece to the puzzle is that the crash is being recorded on windows as coming from libmysql.dll. I searched the 5.1 folders and found a different libmysql.dll in there (Sept vs July creation date). I don't know if that has ANYTHING to do with anything, but it is clear that 1) our crash is intermittent and b) it's libmysql.dll that windows says is at fault.

3) If application number 5 for example fails once, I can restart it and the other applications and application number 5 will consistently fail. However, if I restart the MySql service, application 5 will ussually work but then application 6 may or may not work (and usually doesn't).

None of the above may help us any, but at least it's helpful to catalog our behaiviour in case someone else has the same problem.

Do me a quick and easy favor. Put your calls on a loop so you do several in a row. In our case, it's never the early applications that fail, but the later ones which leads me to believe that you won't see the problem by running the demo once or twice but you may see it after 10 or 100 calls.

Now that we have the source code, I'm going to put my people on it. I have one programmer in particular who is very c++ and mysql savvy. If I can get him to put in the time (he's currently away but back on the 20th), we might be able to crack this nut in no time!

Re: A7csMySql- Preliminary Testing [Re: fastlane69] #41818
12/12/07 06:07
12/12/07 06:07
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
The libmysql that I included with the CSMySQL example was the latest that worked without crashing the engine/plugin last year. When I was trying to get it working again I just tried any libmysql that I could find. Could be that you actually need a previous version or might be that it works with later release also. Not really sure about that though.

Have to say that my demos are very basic and not require heavy load on the database, but I do know that in your case the database connections must be persistent. If I would put a lot of query for the dll to handle it will require a wait(1) to allow the task to complete, at least that's what I thought read somewhere in this topic.

Anyways I think it's best to rewrite with current sdk from http://tangentsoft.net/mysql++/


smile
Re: A7csMySql- Preliminary Testing [Re: D3D] #41819
12/12/07 21:20
12/12/07 21:20
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Quote:

but I do know that in your case the database connections must be persistent




That may have been it after all. We went into the MySQL administrator and changed the max queries per hour per user from 100 to 10000... that seems to be working for us right now.

But thanks for the tip on the new MySQL SDK. 5.1 has a new libmysql.dll and it might be easier to attack this from the ground up instead of building on legacy code. Even if we do have to rebuild completely, Destop's and your work will be of great help. After all, things are easier once you know they CAN be done.

More to come but for now, the max quries change has apprearently stablized things.

Re: A7csMySql- Preliminary Testing [Re: fastlane69] #41820
12/13/07 20:01
12/13/07 20:01
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Pretty sure that was it. Two days several restarts and no failures.
We still have a memory leak coming from it. Not conversant on the details but does that sound familiar (it was a problem with the A6 version as well).

Re: A7csMySql- Preliminary Testing [Re: fastlane69] #41821
12/13/07 20:27
12/13/07 20:27
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Have setup a ready-made project for VC++ 2008 Express, MySQL 5.1 SDK and mySQL++ 2.3.2 SDK. Unfortunately I did not yet ported the functions from Destops DLL, but it's a nice start. I'm just hobbyist so this will take me some time and I can learn from the process. Maybe if there is a strong C++ programmer he/she can do this in a hour.


smile
Re: A7csMySql- Preliminary Testing [Re: D3D] #41822
12/13/07 23:26
12/13/07 23:26
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Tried to update the code a little and got it compiling with few warnings and bunch of linker errors perhaps forgot to add something somewhere, but it's a start.

Code:
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <math.h.>// engine specific header file
#define DLL_USE // always define before including adll.h
#include "stdafx.h"
#include "adll.h" //A6 dll include

#include "mysql++.h" // MySQL++ header

using namespace std;
using namespace mysqlpp;

Result res;
Connection con(use_exceptions);

BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
engine_bind();
return TRUE;
}

//Open database connection
DLLFUNC var mySQL_Connectdb(STRING *db,STRING *host,STRING *user,STRING *password)
{
try { // its in one big try block
//con.connect("test","localhost","user1","password");
con.connect(db->chars,host->chars,user->chars,password->chars);
if ( !con.connected() ) {
return _VAR(0);
}
}
catch (BadQuery er) { // handle any connection or
// query errors that may come up
return _VAR(0);
}
// The full format for the Connection constructor is
// Connection(cchar *db, cchar *host="",
// cchar *user="", cchar *passwd="")
// You may need to specify some of them if the database is not on
// the local machine or you database username is not the same as your
// login name, etc..

//INSERT INTO testtable (name,strengh,stamina,coord) VALUES ("plouf",20,20,20)

return _VAR(1);
}

DLLFUNC var mySQL_ExecQuery(STRING *str)
{
if ( !con.connected() ) {
return _VAR(0);
}

Query query = con.query();// This creates a query object that is bound to con.

query << str->chars;// You can write to the query object like you would any other ostrem

try{
res = query.store();
}
catch(BadQuery er){
return _VAR(0);
}
return _VAR(1);
}

//Reterne result item x of line y from resultset
//Uses Dramatic Result Set
//result[2][5] or result[2]["price"]
DLLFUNC var mySQL_GetVal(var x, var y)
{

double result;

try{
//result=(double)(res[_INT(y)])[_INT(x)];
result=(double)(res.at(_INT(y))).at(_INT(x));
}
catch (BadQuery& er) {
return _VAR(0);
}
catch (BadConversion& er) {
return _VAR(-1);
}
return _VAR(result);
}

//Reterne result item x of line y from resultset
//Uses Dramatic Result Set
//Return value: -2 str too small
// 0 Bad Query
// -1 Not Text Field
DLLFUNC var mySQL_GetStr(STRING *str, var x, var y)
{
try{
//string my_str((res[_INT(y)])[_INT(x)]);
string my_str((res.at(_INT(y))).at(_INT(x)));
my_str+='\0';
if(str->length >= my_str.length())
strcpy(str->chars,my_str.c_str());
else return _VAR(-2);
}
catch (BadQuery& er) {
return _VAR(0);
}
catch (BadConversion& er) {
return _VAR(-1);
}
return _VAR(1);
}

DLLFUNC void mySQL_Closedb()
{
con.close();
}


DLLFUNC var mySQL_IsConnected()
{
return _VAR(con.connected());
}

DLLFUNC var mySQL_RowNumber()
{
return _VAR((double)res.rows());
}




smile
Re: A7csMySql- Preliminary Testing [Re: D3D] #41823
12/14/07 00:45
12/14/07 00:45
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Looking good D!

I'll send this to my guys (who are a lot more than Hobbiest when it comes to programming) and we'll see what we see.

We'll of course post anything we come up with immediately.

Re: A7csMySql- Preliminary Testing [Re: fastlane69] #41824
12/14/07 02:23
12/14/07 02:23
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Yesterday i've uploaded the wrong files, but those are replaced now. I have started to put the commands back into the new dll one by one. The connection function and test if connection is true or false has been completed. If anyone like to try the project and source code can be found on the website's url below. Also if someone know how to do things better don't hesitate to improve

You will need VC++ 2008 and mySQL 5.0+ Server in order to recompile the DLL. To try the current demo.wdl in CSDemo directory, just change the code inside to reflect your personal database configuration and run from SED with -diag.

C-Script mySQL DLL
http://a7-files.nixip.com/gsmysql/BETA/ (files are updated frequently)


smile
Re: A7csMySql- Preliminary Testing [Re: D3D] #41825
12/14/07 19:13
12/14/07 19:13
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Might have it working now and uploaded a new beta dll, with all features as shown in the demo.wdl for C-Script
Requires mySQL Community Server 5.0 or higher. http://a7-files.nixip.com/gsmysql/BETA/


smile
CSmySQL New functions (SSL comming soon) [Re: D3D] #41826
12/17/07 00:27
12/17/07 00:27
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Today i've added some new features to CSmySQL engine extension for GameStudio.

+ Host Info
+ Client Info
+ Database Stats
+ Ping
+ SSL (comming soon)


smile
Page 21 of 24 1 2 19 20 21 22 23 24

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1