Re: OT: (Way OT) PHP and MySQL concurrency control using MyISAM tables

2008-03-26 Thread Bill Moran
In response to Da Rock [EMAIL PROTECTED]:

[massive snip]
 
 I remember now exactly why I wanted MyISAM- you see the table locking is
 exactly what I need for the task. I just need to come up with a method
 to ensure what I send to the server does actually get written- or am I
 just being paranoid?
 
 The task I require needs to offer direct sequential access with no
 undoing of written data. And given the legality of the task based on
 these strict requirements, you can understand my paranoia.

Sounds to me that you want something more like a logfile, where you can
write a line of data, then fsync the file to guarantee that it's been
committed to disk.  Of course, depending on how you'll need to access
this data later, this may not be the best approach.

I don't know the details of how MySQL does or does not guarantee that
your data is safely on disk, but I can say that PostgreSQL uses fsync
after each commit to ensure you're data can not be lost.  From there,
it's up to the hardware, so ensure you have quality disks that don't
lie about caching, and you'll probably want a battery-backed RAID
controller and some sort of disk redundancy (i.e. RAID-10)

-- 
Bill Moran
http://www.potentialtech.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: OT: (Way OT) PHP and MySQL concurrency control using MyISAM tables

2008-03-25 Thread Da Rock

On Sun, 2008-03-23 at 17:01 -0700, Patrick C wrote:
 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 [EMAIL PROTECTED] wrote:
 
 
  On Sun, 2008-03-23 at 19:17 -0400, Bill Moran wrote:
   Da Rock [EMAIL PROTECTED] 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.
 

I remember now exactly why I wanted MyISAM- you see the table locking is
exactly what I need for the task. I just need to come up with a method
to ensure what I send to the server does actually get written- or am I
just being paranoid?

The task I require needs to offer direct sequential access with no
undoing of written data. And given the legality of the task based on
these strict requirements, you can understand my paranoia.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: OT: (Way OT) PHP and MySQL concurrency control using MyISAM tables

2008-03-23 Thread Bill Moran
Da Rock [EMAIL PROTECTED] 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.

-- 
Bill Moran
http://www.potentialtech.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: OT: (Way OT) PHP and MySQL concurrency control using MyISAM tables

2008-03-23 Thread Da Rock

On Sun, 2008-03-23 at 19:17 -0400, Bill Moran wrote:
 Da Rock [EMAIL PROTECTED] 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 [EMAIL PROTECTED]


Re: OT: (Way OT) PHP and MySQL concurrency control using MyISAM tables

2008-03-23 Thread Patrick C
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 [EMAIL PROTECTED] wrote:


 On Sun, 2008-03-23 at 19:17 -0400, Bill Moran wrote:
  Da Rock [EMAIL PROTECTED] 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 
 [EMAIL PROTECTED]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: OT: (Way OT) PHP and MySQL concurrency control using MyISAM tables

2008-03-23 Thread Paul Schmehl
--On March 24, 2008 9:03:35 AM +1000 Da Rock 
[EMAIL PROTECTED] 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.

Any ideas would be very welcome.



Following list etiquette, I'm replying to you and the list.

I believe that postgresql has transaction locking.  You might consider 
using it instead.  Mysql is supposed to have transaction locking in 
version 5.1, but I haven't tested it and don't know how robust it is.


Paul Schmehl ([EMAIL PROTECTED])
Senior Information Security Analyst
The University of Texas at Dallas
http://www.utdallas.edu/ir/security/

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]