You are here: Re: deleting a mysql record in active result « PHP Programming Language « IT news, forums, messages
Re: deleting a mysql record in active result

Posted by Jerry Stuckle on 04/13/06 15:34

fletch wrote:
> I always thought this was ok. It seems simple enough to test, but I
> think reasoning can sort this out.
>
> User A and B make same query at same time.
>
> Query is 'select * from big_table limit 10';
>
> Results are printed out for user A but user B deletes in of the 10 A
> recieved whilst being called.
>
> If the delete counts A no longer has 10 records, unless the sql is run
> again. But then other changes could have happened, and the process
> could repeat indefinately.
>
> I'd say it would be as safe as houses. The only danger is you use the
> same query resource and lose the loop, which is not a db issue but a
> programming one.
>

Fletch,

A completely different scenario. If A is holding locks on the rows, B will not
be able to delete them. However, as owner of the locks, A would still be able
to delete the rows.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация