On 20/11/12 11:50 AM, Markus Hoenicka wrote:
> Mike Rylander<mrylan...@gmail.com>  was heard to say:
>> I think I'd add three calls to the proposed API, though, for support
>> of savepoints.  They're part of the SQL standard, and supported by
>> several SQL RDBMS' including Postgres (the db my project uses, and we
>> use libdbi to connect to PG).  The relevant PG documentation is
>> available at http://www.postgresql.org/docs/9.1/static/sql-savepoint.html
>> .  I have wrappers for savepoints in my implementation, and they are
>> very handy for complex DB interactions.
> Sounds like a no-brainer if it is as simple as you say. I don't keep
> the SQL standard underneath my pillow, but is it safe to assume that
> database engines are responsible to deal with any pending savepoints
> if a transaction is committed (i.e. no extra work for libdbi)?
> This brings up another question. Applications should of course check
> the "transaction_supported" and "savepoints_supported" driver
> capabilities and act responsibly. But if a database engine does not
> support savepoints, or transactions altogether, should libdbi just go
> ahead when asked, or should it throw an error instead? I recall that
> MySQL "supported" transactions in MyISAM tables using no-ops.

That is correct. The transactional engine is InnoDB, and it's the 
recommended one if you care about your data and its integrity.

I would suggest that libdbi should not try to be clever here - it's 
basically infeasible to try and determine whether a sequence of 
statements is transactionally unsafe in some way. For one thing, storage 
engines can be mixed in one MySQL schema, and a sequence of statements 
can involve them in arbitrary combinations (which is very foolish, but 
still). A warning about MyISAM might be placed in the manual, however.

I don't know anything about savepoints so can't comment on that part.


> regards,
> Markus

Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
libdbi-users mailing list

Reply via email to