On Thu, Mar 11, 2010 at 1:57 PM, Jonathan Swartz <[email protected]> wrote:
> Ok. Sounds like this is more expensive than I expected (at least in > Oracle's case). > > Does it save any cost that the update is a "dummy" update, "update id = 1 > where id = 1"? That is, I'm only using the update to reserve the row, not > actually changing any data. > > That is database and database version dependent. The best way to discover the answer to this would be to run a trace of the operations. In the case of Oracle that would be a 10046 trace. I don't know about others. Is this being done on an Oracle database? If so a much better way IMO would be to use the DBMS_LOCK package that is part of the database. The package has the advantage of automatically releasing a lock when the session ends. Jared Still Certifiable Oracle DBA and Part Time Perl Evangelist Oracle Blog: http://jkstill.blogspot.com Home Page: http://jaredstill.com
