From owner-freebsd-questions@FreeBSD.ORG Mon Mar 24 00:01:02 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAE701065672 for ; Mon, 24 Mar 2008 00:01:02 +0000 (UTC) (envelope-from pcloches@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by mx1.freebsd.org (Postfix) with ESMTP id 9A8AF8FC15 for ; Mon, 24 Mar 2008 00:01:02 +0000 (UTC) (envelope-from pcloches@gmail.com) Received: by py-out-1112.google.com with SMTP id u52so3692275pyb.10 for ; Sun, 23 Mar 2008 17:01:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=7JF/SUHjzvCYLMor/abCidfcQ+BRdxK/m0q4uLWWdZU=; b=uLgvGIrFav/aDzmKxKdISE+vFZdQOOapgKPdk0vGHNHV+UFY/MavSTmXno7DJkj1B4vVmOWgzBs9gD/wDpg4BQ8HEjbNdEu8ZUxeIEXudjvMto63gw07C0exulUmk+3L4sS9zxx372A1ENLyi89hW77w/IPySdFqcvwxNNQuMSc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=fXrYA1p0b+AA1CMN1PexsjA3Q8ci9W6d/feZ0Yj/A5wcdLZ1ChH1aOweiNlugb7+pVpttXnmvOggF4Ep9vBG0NFxrhOWc7CUk7PnzT0uOGrmZPy1GfkqXDVI3Cotg7LLEH9N/HW3X7ReHKWhhUIW2O0J5TwcqNFZoWK3epZ0BZA= Received: by 10.114.168.1 with SMTP id q1mr10385946wae.96.1206316861040; Sun, 23 Mar 2008 17:01:01 -0700 (PDT) Received: by 10.114.195.4 with HTTP; Sun, 23 Mar 2008 17:01:00 -0700 (PDT) Message-ID: <34394a3a0803231701n3e125b15nfa866a9dfccfb331@mail.gmail.com> Date: Sun, 23 Mar 2008 17:01:00 -0700 From: "Patrick C" To: freebsd-questions@freebsd.org In-Reply-To: <1206315963.6973.84.camel@laptop2.herveybayaustralia.com.au> MIME-Version: 1.0 References: <1206313415.6973.78.camel@laptop2.herveybayaustralia.com.au> <20080323191727.bd9c5237.wmoran@potentialtech.com> <1206315963.6973.84.camel@laptop2.herveybayaustralia.com.au> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: OT: (Way OT) PHP and MySQL concurrency control using MyISAM tables X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2008 00:01:03 -0000 MyISAM supports locking (like all engines) but not transactions. Without transactions, you can do a lock lock a table or tables, and unlock them, however you cannot roll back statements -- so if a statement down the line fails for some reason there is no way to rollback and undo past statements (automagically at least) The simple solution is to use InnoDB, which supports Good Things you want - it's more scalable across multiple threads, row-level locking, transactions, foreign keys, etc. The differences are fairly well documented. It sounds like you're using PDO, please read up on auto-commit mode. Don't reinvent the wheel, especially when the wheel is already built better than you could hack out a replacement for it :) -Patrick On 23/03/2008, Da Rock wrote: > > > On Sun, 2008-03-23 at 19:17 -0400, Bill Moran wrote: > > Da Rock wrote: > > > > > > I know this is not quite the list for these things, but I tried the > PHP > > > list and got no reply whatsoever. In fact, I don't think anyone's home > > > cause the entire list is silent... > > > > > > I'm trying to setup a system using web apps in PHP using MySQL as the > > > backend database, only this time I need transaction services. > According > > > to the PHP manual if a transaction is served for MySQL it can come > back > > > as committed even though it may not. So what I'm trying to accomplish > is > > > develop some row level locking with the PHP script. > > > > > > I enquired about setting up a servlet (for want of a better term) with > > > PHP, something that will serve the requests of the rest of the app. To > > > be honest though, I'm not entirely sure how to approach this. > > > > Wow. That's one crazy attempt at a workaround. > > > > The correct solution is to use the correct tool for the job. Either > > install PostgreSQL and use it instead, or use InnoDB tables. > > > > > Actually, I think I may have got some facts confused here- I thought > that MyISAM was not supposed to be transaction supported, but according > to most stuff I've read it supports table level transaction locking. > > And the PHP manual says it will only come back with a false commit IF > the table DOESN'T support transactions at all. > > So what is the truth here? If MyISAM supports transaction table locking > I may be ok here- and save myself a hell of a lot of trouble to boot. > > Thanks guys, again. > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" >