Re: SQL Server - do I need PHP to run COMMIT?

From: Date: Fri, 16 Dec 2005 15:40:05 +0000
Subject: Re: SQL Server - do I need PHP to run COMMIT?
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-40875@lists.php.net to get a copy of this message
Yes, the transaction logs are being backed up and shrunk regularly. I am told while they are 400MB most of that is "empty space" and it's really about 50MB in size. Apparently that is still a bit too big and indicates a possible problem. I'm glad all transactions are auto-commited. I presumed that was the case because we have 5 users all using this system at the same time and we have had no apparent problems with data being "saved" but not actually being stored in the database. Everything actually seems to be working fine apart from the remarkably large transaction file. Any ideas why the transaction log file would be so big? Robert Twitty wrote:
Using COMMIT is only required if you issued a BEGIN TRANS before your INSERTs, UPDATEs and / or DELETEs. All transactions are automatically committed if you don't use BEGIN TRANS. Are you backing up the transaction logs regularly? -- bob On Fri, 16 Dec 2005, Alex Gemmell wrote:
Hello people, My PHP application uses a SQL Server 2000 database. I have previously only ever used MySQL and so my knowledge of SQL Server comes just from experimentation and trial and error experience. My PHP application appears to be working fine but I have just discovered that although the database itself is rather small on the disk (about 25MB) the transaction log file is huge (400MB). I have had a quick look at Microsoft's website about large transaction files and they suggest many reasons, one of which is the application not COMMITing transactions. This is certainly true because I simply make INSERT and UPDATE queries but don't include a COMMIT statement. So my question is this: should I be COMMITing? How do I do that? Do I simply run something like this after every INSERT/UPDATE/DELETE: mssql_query('COMMIT', $link_identifier); Please help - I feel like I'm missing a trick here. FYI: I'm also now doubting my use of "mssql_pconnect()" - should I being using "mssql_connect()" with "mssql_close()" instead? Thanks, Alex -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.db (#40875) next »