• Welcome, Guest. Please login.
 
September 17, 2019, 11:09:06 am

News:

Welcome to the SQLitening support forums!


Test code (begin deferred transaction)

Started by mikedoty, September 23, 2007, 03:48:44 am

Previous topic - Next topic

mikedoty

September 23, 2007, 03:48:44 am Last Edit: September 25, 2007, 06:50:14 pm by mikedoty
Updated code moved to 9/25/07 (matches version 3 download from this site)
http://www.dotysoftware.com/sqlddt.bas

mikedoty

September 23, 2007, 03:58:43 am #1 Last Edit: September 23, 2007, 04:23:40 am by mikedoty
If multiple copies of the program are run getting error 1 on the BEGIN statement if the
other copy is in a transaction.  This is a read only transaction. 

If the BEGIN DEFERRED TRANSACTION and COMMIT are removed it works fine if multiple copies are run.

The BEGIN statement and COMMIT statement are in CASE %BUTTON_EXECUTE


Paul Squires

Not really sure why you are wrapping your SELECT sql in a transaction. I will check to see why the BEGIN is blocking the read from the second instance of the program.

mikedoty

Simply testing if transaction processing is working.
From what I've read the BEGIN and COMMIT are internally automatic unless supplied.
So I supplied them to see what happens.


mikedoty

September 25, 2007, 06:42:57 pm #4 Last Edit: September 27, 2007, 07:42:16 am by mikedoty
Updates to this code at http://www.dotysoftware.com/sqlddt.bas
Can't post here because it exceeds 20,000 characters  (25,735 characters.)


mikedoty

September 27, 2007, 07:09:27 am #6 Last Edit: September 27, 2007, 07:38:51 am by mikedoty
I'll bring them up again and post a message.
It is possible to bypass the host.  I don't want this code posted.

Paul,
Should bypassing the connection (to avoid the host) be an option?
It works by not specifying locahost.  Perhaps this is good.

mikedoty


Paul Squires

Quote from: mikedoty on September 27, 2007, 07:09:27 am
Paul,
Should bypassing the connection (to avoid the host) be an option?
It works by not specifying locahost.  Perhaps this is good.

I just looked at the code. It seems that if the Host is not specified then PowerBASIC's TCP functions will default to using "LocalHost".

This is the call that the client makes when it attempts to connect to the server. If sHost is blank then it seems to connect to the LocalHost.


   Tcp Open Port nPort At sHost As hSocket


mikedoty

Curious, do you want the client to be able to bypass the host completely?

Paul Squires

Also, you can force your database to be created/opened on the local client machine by simply using %SQL3_LOCAL in the sql3_Use function. This allows you to pick and choose which databases you want to access on the local machine and which ones from the server.

so, you can open a connection to a server but still open and access databases on th elocal machine (e.g. a local configuration file).

Paul Squires

Quote from: mikedoty on September 27, 2007, 08:27:42 am
Curious, do you want the client to be able to bypass the host completely?

Not sure which way is best. The library should not be forced to have to always operate in Client/Server mode. That's why %SQL3_REMOTE and %SQL3_LOCAL were introduced.

Would you prefer for the library to throw and error if the Host is blank?

mikedoty

Not sure.   Direct access is faster, but the host isn't doing its thing.
Could cause security problems?  If running local the host isn't necessary, so I don't know.

mikedoty

Client is running Windows 98 SE
Host  is running  XP Pro SP2
Connecting down the internet from the client using Windows 98 SE
Click Start session
Click Connect
Click Execute
Click End session
Abends
Test code can be downloaded at http://www.dotysoftware.com/sqlddt.bas
I may have to start zipping the file since downloads have been truncated for some unknown reason.
I think my ISP may have a virus program or something that is doing it.  If truncated, please let me know.

It works fine if disconnect is clicked before ending the session using Windows 98 SE.
This does not happen using XP, but the client and the host are on that machine.
I'll reverse the process so the Windows 98 SE machine is the host and see if it abends on XP.

Paul,
If you ever want to use my host then lset me know and I'll supply an IP and port.



mikedoty

September 27, 2007, 09:32:53 am #14 Last Edit: September 27, 2007, 09:42:11 am by mikedoty
Host is Windows 98 SE
Client is Windows XP Pro
Connected down the internet
Client abends if Start session, connect, execute transaction, end session (without disconnect.)
Add disconnect code to end session and also if the windows is closed fixed this problem.