logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
SQLServer
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
lostdreamz



Joined: 19 Nov 2006
Posts: 26

PostPosted: Sat Feb 10, 2007 20:36    Post subject: Reply with quote

Putting SQLExecDirect("COMMIT") into the on module load made no difference at all. The database is still locked and the select statements are hours out of date.
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sat Feb 10, 2007 23:59    Post subject: Reply with quote

lostdreamz wrote:
Putting SQLExecDirect("COMMIT") into the on module load made no difference at all. The database is still locked and the select statements are hours out of date.


We have two versions of SQLite available as plugins. One transaction safe (NWNXJr) and the other not (SQLite). This is simply the way the plugin transaction model is designed.

Currently the SQLite doesn't commit until the next SQL statement is issued/requested. If a crash should happen during this period you will lose any data from the last INSERT, UPDATE or DELETE action. (or combo if you are issuing multi-SQL commands)

You can work-around this by adding a SQLExecDirect("COMMIT") whenever you want to make sure data is really stored. (Internally this will cause a COMMIT;BEGIN and when you issue the next statement commit an empty transaction). SQLite will still loose data if the server crashes in the middle of a one of these - shorter - transactions.

Cheers
Gryphyn
Back to top
View user's profile Send private message
lostdreamz



Joined: 19 Nov 2006
Posts: 26

PostPosted: Sun Feb 11, 2007 13:26    Post subject: Reply with quote

Thanks thats what I needed to know =)
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sat Apr 07, 2007 15:43    Post subject: Re: SQLServer Reply with quote

Gryphyn wrote:
lostdreamz wrote:
Is there any update on when the plugin for SQLServer is going to be ready. Its so much more powerful than SQLite and doesnt lock the database which is a big problem when the module is running. I cant change anything.

Thank you

Rebecca Casidy (owner World of Desire 2:Ryhiron)


Working on an ODBC solution - which will include SQLServer access.
--conditional on my Vista installation allowing continued development.

Cheers
Gryphyn


Here's an update.

I've given ODBC the flick - too many distractions from getting access to SQLServer... using sqlncli (Sql Native Client - uses ODBC API)
I'm connected, and just need to write the Request options.

Word of 1.05 additions got me working on UserDefinedTypes - I've now got the set of NWN(1&2) data types as 'column' types in the database, and some specials. So you can now read/write the data directly to/from the database (Should make the new 1.05 functions much easier)

sqlxInteger
sqlxFloat
sqlxVector -- sqlxFloat X, sqlxFloat Y, sqlxFloat z
sqlxResource -- UTF8 String up to 32 characters (ResRef)
sqlxName -- UTF8 String up to 128 characters
sqlxString -- UTF8 String up to 8000 bytes [SqlServer limit]
sqlxLocation -- sqlxResource Area, sqlxVector Vector, sqlxFloat Facing
sqlxObject

If we only had Easter breaks more often...

Cheers
Gryphyn
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sat Apr 28, 2007 2:04    Post subject: Reply with quote

It's here NWNX4 SQLServer plug-in

This will get you started with SQLServer or SQLServer-Express.
The Express version being the default.

Standard "sql_include" functionality is provided.
Read the contribution notes.

Cheers
Gryphyn
Back to top
View user's profile Send private message
Balo



Joined: 12 May 2007
Posts: 4

PostPosted: Sat May 12, 2007 15:40    Post subject: Reply with quote

Gryphyn wrote:
It's here NWNX4 SQLServer plug-in

This will get you started with SQLServer or SQLServer-Express.
The Express version being the default.

Standard "sql_include" functionality is provided.
Read the contribution notes.

Cheers
Gryphyn


Thanks for making this available, Gryphyn. I tried it out, put the dll and ini in my nwn2 directory, configured the ini, and backed out the mysql dll and ini. When I start nwnx4, it says hook installed, but no xp_sqlserver.txt file is generated, and it doesn't appear there is database connectivity. Am I doing something wrong?
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat May 12, 2007 16:50    Post subject: Reply with quote

Please post the contents of nwnx.txt after launching it with the sql server plugin enabled.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sun May 13, 2007 4:26    Post subject: Reply with quote

You could also try looking for a .log file (rather than .txt)

Cheers
Gryphyn
Back to top
View user's profile Send private message
krazzybone



Joined: 17 Jul 2008
Posts: 2

PostPosted: Mon Jul 21, 2008 20:27    Post subject: Im lost please help me , sorry to bother Reply with quote

Im totally lost as to where these files get unzipped to, and everytime I try to edit xp_sqlserver.ini, i get errors it says its read only

// xp_sqlserver.txt

NWNX SQLServer Plugin V.106.108.0.9 (CTP)
(c) 2007 by Rob Lobbe (Gryphyn)
visit us at http://www.nwnx.org

* Log level set to 2 (everything)
Instance: .\SQLEXPRESS
Database: NeverwinterNights2
Trusted connection
! [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
* Connection to SQLServer failed!

//NWNX4

2:47:03 PM: Running in GUI mode.
2:47:03 PM: Worker thread started.
2:47:03 PM: Starting the NWN Server.
2:47:08 PM: * Hook installed and initialized succesfully

// xp_sqlite.txt

NWNX SQLite Plugin V.0.0.8
(c) 2007 by Ingmar Stieger (Papillon)
visit us at http://www.nwnx.org
(built using SQLite 3.3.17)

* Log level set to 2 (everything)
* SQLite database file is C:\NWNX4\sqlite.db
* Plugin initialized.
* Registering under function class SQL

// NWNX.txt

NWN Extender 4 V.0.0.8
(c) 2007 by Ingmar Stieger (Papillon)
visit us at http://www.nwnx.org

* Loading plugins...
* Loading plugin xp_sqlite.dll: Successfully registered as class: SQL
* Loading plugin xp_sqlserver.dll: Error during plugin initialization.
* Loading plugin xp_time.dll: Successfully registered as class: TIME
* Disabling general protection fault error dialog.
* NWNX4 activated.

Theres all the info as I am not so good at explaining really what is happening hehe. thanks for any help.
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Tue Jul 22, 2008 1:15    Post subject: Re: Im lost please help me , sorry to bother Reply with quote

krazzybone wrote:
Im totally lost as to where these files get unzipped to, and everytime I try to edit xp_sqlserver.ini, i get errors it says its read only
.

If xp_sqlserver.ini is read-only, change it. *RClick->Properties.

Instance: .\SQLEXPRESS
Database: NeverwinterNights2
This assumes you have SQLServer express database installed. (for other SQLServer's it's <host>\<instance_name>)
If you don't have SQLServer this plugin will not do any good, and you should remove it. (hint: Data source name not found)

Cheers
Gryphyn
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sat Aug 09, 2008 5:05    Post subject: Reply with quote

SQLServer plugin

Well it's here... a SQLServer plugin for NWNX^2

There has been some major rework of the back-end hence the separate plugin, and not an extra option for the existing ODBC plugin.

I think the major 'usability' improvement, that you'll all love is the removal of all the SQL syntax string manipulation. It's still here, but you have an alternative where it's not required.

Introducing Parameters. Add a parameter indicator ('?') to your SQL Statement and this will be replaced by the value of a SQLBind...() function.

SQLPrepare("{call [stored_proc] (?)}");
// or SQLPrepare("select value from table where key=?");
SQLBindString("MyKey");

Note the new function SQLPrepare(), allows us to SQLBind...() variables, in sequence, before we SQLExecute(). If you are using parameters you must SQLPrepare() the SQL command first. Your SQL will be easier to write AND much easier to read. Wink

Technically we've added 'usability' to Objects. Objects and other data types can now be returned in the same result set. No need for a separate query to get the Object data.

int i = SQLGetInt(1);
object o = SQLGetObject(2);
string s = SQLGetString(3);

will all work from the same result-set (*columns must be accessed in sequence)

NB: A special exception exists for SQLBindObject(). You can only bind one object per SQL statement and it MUST be the last parameter. Hint: adding Object data is best done via a stored procedure.

With the improvements to Object fetching, I no longer needed this - but I left it in, MARS - Multiple ACTIVE result sets. You can now have up to 4 active result sets. A new command SQLContext() enables you to switch between each 'context' to use the results of one as in 'input' for another, without destroying the original.

Getting into trouble? Full ODBC diagnostics are added into the log file, to assist with those queries that 'break' on you Wink

You get all this and more...
(but only with SQLServer 2005 or better - defaulting to the EXPRESS editions *the free ones)
at the give-away price of - Oh yeah I'm giving it away!

Cheers
Gryphyn

PS. Compiled on VistaUltimate SP1 using VisualStudio2008.
I'll release the source once NWNX^2 goes semi-final for NWN1.69 Cool
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Wed Oct 01, 2008 14:55    Post subject: Reply with quote

I'm assuming this is still a solo project...
but anyone wanting an update for SQLServer 2008 (I've added the new SQLServer 2008 Native Client) send me a PM and I'll send you an update.
(still clocking in at about 5~10 times faster than the MySQL plugin)

Cheers
Gryphyn

[Ed. this ones the NWN1 SQLServer plugin]
Back to top
View user's profile Send private message
chris421



Joined: 07 Apr 2005
Posts: 53

PostPosted: Sat Nov 15, 2008 9:02    Post subject: Reply with quote

Pulled down the binary from your contributions page.

Quote:

* Loading plugin xp_sqlserver.dll: Error. The plugin is not compatible with this version of NWNX.


Guess it doesn't work with Pap's nwnx4 1.09.

Definite interest in seeing this in action. Please update your contributions binary.

Thanks!
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Sat Nov 15, 2008 11:47    Post subject: Reply with quote

chris421 wrote:
Pulled down the binary from your contributions page.

Quote:

* Loading plugin xp_sqlserver.dll: Error. The plugin is not compatible with this version of NWNX.


Guess it doesn't work with Pap's nwnx4 1.09.

Definite interest in seeing this in action. Please update your contributions binary.

Thanks!
It should work with the latest pre-1.10 build:
http://www.nwnx.org/phpBB2/viewtopic.php?p=9520#9520
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sat Nov 15, 2008 13:07    Post subject: Reply with quote

There are two versions...
The current one is for NWNX2. (NWN1)
There is an older proof-of-concept one for NWNX4 (NWN2)

**Make sure you've got the right one.

--I'm currently working on bringing the NWNX4 one in-line with the NWNX2 one, as I've grown accustom to the easier coding requirements (than offered by the NWNX base/core.)

I have a new job, so finding time is a bit more difficult at the moment.

Cheers
Gryphyn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 2 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group