What if the queries were updates instead of inserts? Would I need or be
able to lock the tables then?
Can I go without locking the bdb tables and not worry about the data
integrity on those tables during updates and inserts?
-Seth Hall
Student Programmer
Ohio State University Main Library
On 24 May 2001 16:54:42 -0700, Jeremy Zawodny wrote:
> On Thu, May 17, 2001 at 12:35:09PM -0400, Seth Hall wrote:
> >
> > Hi, could someone point me to a tutorial on when to do table locking
> > with the BDB tables in MySQL?
>
> Why?
>
> > I'm running version 3.23.37 on RH7.0 (with BDB tables :) and if I
> > attempt to do locking within a transaction, the transaction is
> > automatically committed leaving me with non-working transaction
> > code. So, what I'm wondering is do I even need to lock the
> > tables(I'm doing inserts and updates)? If I do, have there been any
> > bugs with locking inside transactions?
> >
> > BTW, if I don't do the table write locking the code works fine.
> >
> > this works....
> > ========
> > begin work;
> > insert into Table (field1, field2) VALUES (2,'hi');
> > rollback;
> > ========
> >
> > this doesn't....it's committed anyway
> > ========
> > begin work;
> > lock tables Table write;
> > insert into Table (field1, field2) VALUES (2,'hi');
> > unlock tables;
> > rollback;
> > ========
>
> Why is the lock necessary at all?
>
> Jeremy
> --
> Jeremy D. Zawodny, <[EMAIL PROTECTED]>
> Technical Yahoo - Yahoo Finance
> Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 439-9951
>
> MySQL 3.23.29: up 5 days, processed 35,049,645 queries (79/sec. avg)
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php