Re: Lock tables in myisam

2003-09-18 Thread daniel
> Hi,
>
> No, ROLLBACK doesn't work with MyISAM. Jeremy meant that you can add
> logic/code between LOCK/UNLOCK to "simulate" ROLLBACK. e.g. queries
> that "undo" what you did if something goes wrong. Of course this won't
> cover you if mysqld dies, is killed, or you lose the connection etc. as
> real transactions would.
>
>

Will it be worth my while then to do lock tables, on one of the projects we
have about 6 people entering data pretty much at the same time people are
searching/reading.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Lock tables in myisam

2003-09-18 Thread Jeremy Zawodny
On Thu, Sep 18, 2003 at 11:38:17AM +1000, electroteque wrote:
> rollback works on myisam ? this is mysql4 anyway, sweet i'll give it a
> try.

No.  That's what I meant about having to put extra smarts in your code.
It needs to be able to undo its actions.

> On Fri, 2003-09-19 at 08:01, Jeremy Zawodny wrote:
> > On Thu, Sep 18, 2003 at 03:00:17PM +1000, [EMAIL PROTECTED] wrote:
> > > Hi there i have a couple of projects which required fulltext searching so
> > > was unable to setup innodb on these. I was wondering if lock tables is a
> > > secure way to make the transaction on these tables and does this prevent
> > > being read upon aswell?
> > 
> > Obtaining a WRITE lock on a MyISAM table prevents readers, yes.
> > 
> > But you do have to put the necessary smarts into your code to properly
> > implement a ROLLBACK if you need one.
> > 
> > Jeremy
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> 

-- 
Jeremy D. Zawodny |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<[EMAIL PROTECTED]>  |  http://jeremy.zawodny.com/

MySQL 4.0.15-Yahoo-SMP: up 4 days, processed 189,881,535 queries (440/sec. avg)

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Lock tables in myisam

2003-09-18 Thread daniel
Righty, so if error unlock table hehe, i have found i need to produce my
error first then do a rollback for an error to display in php as it wouldnt
show a mysql error after a rollback, i guess i could add an unlock table in
my trigger error function too.

> At 11:38 AM +1000 9/18/03, electroteque wrote:
>>rollback works on myisam ? this is mysql4 anyway, sweet i'll give it a
>>try.
>
> Rollback *doesn't* work with MyISAM, that's why Jeremy said you have to
> put the necessary logic in your application if you want to achieve the
> same effect.
>
> At least, that's what I think he said. :-)
>
>>
>>On Fri, 2003-09-19 at 08:01, Jeremy Zawodny wrote:
>>>  On Thu, Sep 18, 2003 at 03:00:17PM +1000, [EMAIL PROTECTED]
>>>  wrote:
>>>  > Hi there i have a couple of projects which required fulltext
>>>  > searching so was unable to setup innodb on these. I was wondering
>>>  > if lock tables is a secure way to make the transaction on these
>>>  > tables and does this prevent being read upon aswell?
>>>
>>>  Obtaining a WRITE lock on a MyISAM table prevents readers, yes.
>>>
>>>  But you do have to put the necessary smarts into your code to
>>>  properly implement a ROLLBACK if you need one.
>>>
>>  > Jeremy
>
>
> --
> Paul DuBois, Senior Technical Writer
> Madison, Wisconsin, USA
> MySQL AB, www.mysql.com
>
> Are you MySQL certified?  http://www.mysql.com/certification/




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Lock tables in myisam

2003-09-18 Thread daniel

>
> No rollback does not work on myisam Jeremy was stating that you don't
> have to do what you suggested to implement a correct ROLLBACK in mySQL.
> Use INNODB.
>
> http://www.mysql.com/doc/en/COMMIT.html
>
>

Hmm if you got my other post i am trying to simulate innodb in myisiam for
projects that require fulltext search i have no choice.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Lock tables in myisam

2003-09-18 Thread Matt W
Hi,

No, ROLLBACK doesn't work with MyISAM. Jeremy meant that you can add
logic/code between LOCK/UNLOCK to "simulate" ROLLBACK. e.g. queries that
"undo" what you did if something goes wrong. Of course this won't cover
you if mysqld dies, is killed, or you lose the connection etc. as real
transactions would.


Matt


- Original Message -
From: "electroteque"
Sent: Wednesday, September 17, 2003 8:38 PM
Subject: Re: Lock tables in myisam


> rollback works on myisam ? this is mysql4 anyway, sweet i'll give it a
> try.
>
> On Fri, 2003-09-19 at 08:01, Jeremy Zawodny wrote:
> > On Thu, Sep 18, 2003 at 03:00:17PM +1000, [EMAIL PROTECTED]
wrote:
> > > Hi there i have a couple of projects which required fulltext
searching so
> > > was unable to setup innodb on these. I was wondering if lock
tables is a
> > > secure way to make the transaction on these tables and does this
prevent
> > > being read upon aswell?
> >
> > Obtaining a WRITE lock on a MyISAM table prevents readers, yes.
> >
> > But you do have to put the necessary smarts into your code to
properly
> > implement a ROLLBACK if you need one.
> >
> > Jeremy


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Lock tables in myisam

2003-09-18 Thread Paul DuBois
At 11:38 AM +1000 9/18/03, electroteque wrote:
rollback works on myisam ? this is mysql4 anyway, sweet i'll give it a
try.
Rollback *doesn't* work with MyISAM, that's why Jeremy said you have
to put the necessary logic in your application if you want to achieve
the same effect.
At least, that's what I think he said. :-)

On Fri, 2003-09-19 at 08:01, Jeremy Zawodny wrote:
 On Thu, Sep 18, 2003 at 03:00:17PM +1000, [EMAIL PROTECTED] wrote:
 > Hi there i have a couple of projects which required fulltext searching so
 > was unable to setup innodb on these. I was wondering if lock tables is a
 > secure way to make the transaction on these tables and does this prevent
 > being read upon aswell?
 Obtaining a WRITE lock on a MyISAM table prevents readers, yes.

 But you do have to put the necessary smarts into your code to properly
 implement a ROLLBACK if you need one.
 > Jeremy


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Are you MySQL certified?  http://www.mysql.com/certification/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Lock tables in myisam

2003-09-18 Thread Dathan Vance Pattishall
 
 
- Dathan Vance Pattishall
  - Sr. Programmer and mySQL DBA for FriendFinder Inc.
  - http://friendfinder.com/go/p40688
 
 
-->-Original Message-
-->From: electroteque [mailto:[EMAIL PROTECTED]
-->Sent: Wednesday, September 17, 2003 6:38 PM
-->To: [EMAIL PROTECTED]
-->Subject: Re: Lock tables in myisam
-->
-->rollback works on myisam ? this is mysql4 anyway, sweet i'll give it
a
-->try.
 
No rollback does not work on myisam Jeremy was stating that you don't
have to do what you suggested to implement a correct ROLLBACK in mySQL.
Use INNODB.
 
http://www.mysql.com/doc/en/COMMIT.html
 
 


Re: Lock tables in myisam

2003-09-18 Thread electroteque
rollback works on myisam ? this is mysql4 anyway, sweet i'll give it a
try.

On Fri, 2003-09-19 at 08:01, Jeremy Zawodny wrote:
> On Thu, Sep 18, 2003 at 03:00:17PM +1000, [EMAIL PROTECTED] wrote:
> > Hi there i have a couple of projects which required fulltext searching so
> > was unable to setup innodb on these. I was wondering if lock tables is a
> > secure way to make the transaction on these tables and does this prevent
> > being read upon aswell?
> 
> Obtaining a WRITE lock on a MyISAM table prevents readers, yes.
> 
> But you do have to put the necessary smarts into your code to properly
> implement a ROLLBACK if you need one.
> 
> Jeremy


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Lock tables in myisam

2003-09-18 Thread Jeremy Zawodny
On Thu, Sep 18, 2003 at 03:00:17PM +1000, [EMAIL PROTECTED] wrote:
> Hi there i have a couple of projects which required fulltext searching so
> was unable to setup innodb on these. I was wondering if lock tables is a
> secure way to make the transaction on these tables and does this prevent
> being read upon aswell?

Obtaining a WRITE lock on a MyISAM table prevents readers, yes.

But you do have to put the necessary smarts into your code to properly
implement a ROLLBACK if you need one.

Jeremy
-- 
Jeremy D. Zawodny |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<[EMAIL PROTECTED]>  |  http://jeremy.zawodny.com/

MySQL 4.0.15-Yahoo-SMP: up 4 days, processed 188,913,819 queries (445/sec. avg)

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]