Re: [libdbi-users] libdbi transaction support

2013-01-26 Thread Toby Thain
On 26/01/13 8:30 PM, markus.hoeni...@mhoenicka.de wrote:
> Toby Thain writes:
>   >  Yes, you just found out the hard way that it's wise to include ENGINE
>   >  specifications in MySQL CREATE TABLE's.
>   >
>
> True indeed.

Actually I think the news is even worse: I seem to recall that MySQL can 
even *ignore* ENGINE specifications if the engine isn't installed. 
Leaving you, again, with MyISAM-the-inadequate.

More silent fail. I think I've wasted some time on that one in the past.

--Toby


>
> regards,
> Markus
>


--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2013-01-26 Thread markus . hoenicka
Toby Thain writes:
 > Yes, you just found out the hard way that it's wise to include ENGINE 
 > specifications in MySQL CREATE TABLE's.
 > 

True indeed. The problem with MySQL's storage engines is that the
transaction_support and savepoint_support driver capabilities cannot
be relied upon because they depend on a couple of factors - how the
database server was compiled and configured, how particular tables
were created and so on. The driver caps may get things wrong in quite
a few cases.

BTW I've finished updating the test kit which should now cover all
aspects of transactions and savepoints as well. I'd greatly appreciate
if everyone could give the current cvs revisions a try and report
success and failures.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2013-01-25 Thread Toby Thain
On 25/01/13 7:40 PM, markus.hoeni...@mhoenicka.de wrote:
> Markus Hoenicka writes:
>   >  Another possible reason for problems is the table type. If someone
>   >  uses MyISAM tables, the result I got would be expected. However, MySQL
>   >  uses InnoDB tables as default these days, and I double-checked that
>   >  they were used in my tests.
>
> Turns out that InnoDB is the default engine only in versions 5.5.5 and
> later. On my box, MyISAM tables were created by default. The test

Yes, you just found out the hard way that it's wise to include ENGINE 
specifications in MySQL CREATE TABLE's.

They took far too long to change the default engine to InnoDB.

--Toby

> correctly found out that the latter don't support transactions :-(
>
> I've changed the CREATE TABLE statement on my box to ask for InnoDB
> tables instead. This eliminates the failure of the rollback test.
>
> I'll try and finish the test suite asap. The transaction tests require
> some polish as they should run only if the driver supports
> transactions.
>
> regards,
> Markus
>


--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2013-01-25 Thread markus . hoenicka
Markus Hoenicka writes:
 > Another possible reason for problems is the table type. If someone  
 > uses MyISAM tables, the result I got would be expected. However, MySQL  
 > uses InnoDB tables as default these days, and I double-checked that  
 > they were used in my tests.

Turns out that InnoDB is the default engine only in versions 5.5.5 and
later. On my box, MyISAM tables were created by default. The test
correctly found out that the latter don't support transactions :-(

I've changed the CREATE TABLE statement on my box to ask for InnoDB
tables instead. This eliminates the failure of the rollback test.

I'll try and finish the test suite asap. The transaction tests require
some polish as they should run only if the driver supports
transactions.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2013-01-25 Thread Markus Hoenicka

Rainer Gerhards  was heard to say:

> we have given it a try today and things look pretty good :-).

Sounds good :-)

> Unfortunately, we can reproduce the problem with MySQL. I barely  
> remember that MySQL by default has implicit commits enabled, what  
> needs to be turned off if you need real ones.
>

As Olivier already mentioned, any eplicit START TRANSACTION overrides  
autocommit, so this shouldn't interfere here. Even if an application  
using libdbi turns autocommit off or on deliberately, START  
TRANSACTION should still work as expected.

Another possible reason for problems is the table type. If someone  
uses MyISAM tables, the result I got would be expected. However, MySQL  
uses InnoDB tables as default these days, and I double-checked that  
they were used in my tests.

I'll try to test the pgsql driver on the weekend to see if that causes  
problems too. I'll also check the MySQL logs to see if I find  
something weird, and I'll run some transactions in MySQL's plain ol'  
command line interface just to make sure it isn't MySQL playing tricks  
on us.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38



--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2013-01-25 Thread Olivier Doucet
Hello,

> we have given it a try today and things look pretty good :-). Unfortunately, 
> we can reproduce the problem with MySQL. I barely remember that MySQL by 
> default has implicit commits enabled, what needs to be turned off if you need 
> real ones.

By default, MySQL has autocommit enabled. This is disabled
automatically when you issue "START TRANSACTION" statement (or changed
default behaviour in MySQL config file).

See http://dev.mysql.com/doc/refman/5.5/en/commit.html

Olivier

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2013-01-25 Thread Rainer Gerhards
> I've checked in new versions of libdbi/src/dbi_main.c containing the
> implementations of the transaction functions and libdbi-
> drivers/tests/test_dbi.c with a first shot at the required test functions.
> MySQL seems to fail to rollback transactions on my box whereas SQLite3
> succeeds. I'm too tired now to track this down, maybe someone else can
> have a look at this too. I hope I'll get back to this on the weekend.

Hi Markus,

we have given it a try today and things look pretty good :-). Unfortunately, we 
can reproduce the problem with MySQL. I barely remember that MySQL by default 
has implicit commits enabled, what needs to be turned off if you need real ones.

At least I have check the tx support in our native mysql driver that Ulrike did 
and there is this call. Maybe it's useful for you:
http://git.adiscon.com/?p=rsyslog.git;a=blob;f=plugins/ommysql/ommysql.c;h=2dfa29de74bd4b172ea6073bb970759753ace491;hb=HEAD#l223

Thanks again for your help!
Rainer

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2013-01-24 Thread markus . hoenicka
Rainer Gerhards writes:
 > > Zitat von Rainer Gerhards :
 > > 
 > > > sorry for the long silence, we got sidetracked ourselfs. Finally, we
 > > > yesterday tried to write some test programs to get started. To do so,
 > > > I did a cvs checkout for both libdbi and libdbi-drivers (according to
 > > > instructions on the site). I can see the new transaction functions
 > > > inside the sgml files as well as the headers.
 > > > However, I do not find any implementation (.c files).
 > > >
 > > > Am I overlooking something?
 > > >
 > > 
 > > No. Apparently my bad. I'll fix that tonight.
 > 
 > Thanks a lot!
 > Rainer

I've checked in new versions of libdbi/src/dbi_main.c containing the
implementations of the transaction functions and
libdbi-drivers/tests/test_dbi.c with a first shot at the required test
functions. MySQL seems to fail to rollback transactions on my box
whereas SQLite3 succeeds. I'm too tired now to track this down, maybe
someone else can have a look at this too. I hope I'll get back to this
on the weekend.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2013-01-24 Thread Rainer Gerhards
> Rainer Gerhards writes:
>  > > This should be easy to retrofit. I'lls see if I find  > > some time but 
> feel
> free to beat me at it.
>  >
>  > I am quite busy myself at the moment, but I could try and see if I  > could
> craft something along that path...
>  >
> 
> Hi all,
> 
> I've stolen some time from myself to provide a first shot at transaction and
> savepoint support, see the current cvs revisions of libdbi and libdbi-drivers.
> The code is entirely untested except that the drivers which I use myself
> compile and don't crash upon loading. I didn't get round to adding the
> documentation and the tests, but feel free to test the current code yourself.
> Usage should be pretty obvious if you look at the diffs. I'm sure some rough
> edges remain, but then... it's a start.

Hi Markus,

sorry for the long silence, we got sidetracked ourselfs. Finally, we yesterday 
tried to write some test programs to get started. To do so, I did a cvs 
checkout for both libdbi and libdbi-drivers (according to instructions on the 
site). I can see the new transaction functions inside the sgml files as well as 
the headers. However, I do not find any implementation (.c files).

Am I overlooking something?

Rainer

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2013-01-24 Thread Rainer Gerhards
> Zitat von Rainer Gerhards :
> 
> > sorry for the long silence, we got sidetracked ourselfs. Finally, we
> > yesterday tried to write some test programs to get started. To do so,
> > I did a cvs checkout for both libdbi and libdbi-drivers (according to
> > instructions on the site). I can see the new transaction functions
> > inside the sgml files as well as the headers.
> > However, I do not find any implementation (.c files).
> >
> > Am I overlooking something?
> >
> 
> No. Apparently my bad. I'll fix that tonight.

Thanks a lot!
Rainer

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2013-01-24 Thread Markus Hoenicka

Zitat von Rainer Gerhards :

> sorry for the long silence, we got sidetracked ourselfs. Finally, we  
> yesterday tried to write some test programs to get started. To do  
> so, I did a cvs checkout for both libdbi and libdbi-drivers  
> (according to instructions on the site). I can see the new  
> transaction functions inside the sgml files as well as the headers.  
> However, I do not find any implementation (.c files).
>
> Am I overlooking something?
>

No. Apparently my bad. I'll fix that tonight.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38



--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2012-12-08 Thread markus . hoenicka
markus.hoeni...@mhoenicka.de writes:
 > I've stolen some time from myself to provide a first shot at
 > transaction and savepoint support, see the current cvs revisions of
 > libdbi and libdbi-drivers. The code is entirely untested except that
 > the drivers which I use myself compile and don't crash upon loading. I
 > didn't get round to adding the documentation and the tests, but feel
 > free to test the current code yourself. Usage should be pretty obvious
 > if you look at the diffs. I'm sure some rough edges remain, but
 > then... it's a start.
 > 

FYI I've also updated the docs in cvs to reflect the latest changes.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2012-12-02 Thread markus . hoenicka
Rainer Gerhards writes:
 > > This should be easy to retrofit. I'lls see if I find
 > > some time but feel free to beat me at it.
 > 
 > I am quite busy myself at the moment, but I could try and see if I
 > could craft something along that path...
 > 

Hi all,

I've stolen some time from myself to provide a first shot at
transaction and savepoint support, see the current cvs revisions of
libdbi and libdbi-drivers. The code is entirely untested except that
the drivers which I use myself compile and don't crash upon loading. I
didn't get round to adding the documentation and the tests, but feel
free to test the current code yourself. Usage should be pretty obvious
if you look at the diffs. I'm sure some rough edges remain, but
then... it's a start.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38

--
Keep yourself connected to Go Parallel: 
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2012-11-20 Thread Toby Thain
On 20/11/12 11:50 AM, Markus Hoenicka wrote:
> Mike Rylander  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.

--Toby

>
> 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!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2012-11-20 Thread Markus Hoenicka
Mike Rylander  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.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38



--
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!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2012-11-20 Thread Mike Rylander
On Tue, Nov 20, 2012 at 7:59 AM, Rainer Gerhards  wrote:
> On Tue, Nov 20, 2012 at 1:02 PM, Markus Hoenicka
>  wrote:
>> In fact, we already have a (not well documented) infrastructure for things
>> like this in place. Every driver keeps a list of boolean "capabilities"
>> which is merely a key-value list of whatever we think is useful or
>> necessary. To date, only the "safe_dlclose" capability seems to be used, see
>> e.g. dbd_initialize in libdbi-drivers/drivers/mysql/dbd_mysql.c. There is an
>> internal function _dbd_register_driver_cap() which can be used by the
>> drivers to announce a capability. And there is a public function
>> dbi_driver_cap_get() which allows applications to query the list of
>> capabilities at runtime. So all we'd have to do is modify the drivers and
>> have them add a "transaction_support" capability set to 1 for those who
>> support transactions.
>
> ok, that makes sense and is excellent to have!
>
>>> For TX support, I'd expect calls for
>>>
>>> - begin transaction
>>> - commit
>>> - rollback
>>>
>>> that's it, so all in all 4 calls. Would you agree to that?
>>

First, I'm glad to so movement on this! The code in the project I'm
involved with handles transactions on its own already using something
along the lines of the wrapper pattern Markus mentioned, so it won't
make a big difference to me immediately, but having a sanctioned API
is almost always better, IMO.

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.

I can't offer many properly shaped tuits toward the development effort
right now, but supporting savepoints should amount to essentially
adding cut-and-paste duplicates of begin, commit and rollback.  Would
it be objectionable to ask for savepoint support to piggy-back on
transaction support?

-- 
Mike Rylander
 | Director of Research and Development
 | Equinox Software, Inc. / Your Library's Guide to Open Source
 | phone:  1-877-OPEN-ILS (673-6457)
 | email:  mi...@esilibrary.com
 | web:  http://www.esilibrary.com

--
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!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2012-11-20 Thread Rainer Gerhards
On Tue, Nov 20, 2012 at 1:02 PM, Markus Hoenicka
 wrote:
> In fact, we already have a (not well documented) infrastructure for things
> like this in place. Every driver keeps a list of boolean "capabilities"
> which is merely a key-value list of whatever we think is useful or
> necessary. To date, only the "safe_dlclose" capability seems to be used, see
> e.g. dbd_initialize in libdbi-drivers/drivers/mysql/dbd_mysql.c. There is an
> internal function _dbd_register_driver_cap() which can be used by the
> drivers to announce a capability. And there is a public function
> dbi_driver_cap_get() which allows applications to query the list of
> capabilities at runtime. So all we'd have to do is modify the drivers and
> have them add a "transaction_support" capability set to 1 for those who
> support transactions.

ok, that makes sense and is excellent to have!

>> For TX support, I'd expect calls for
>>
>> - begin transaction
>> - commit
>> - rollback
>>
>> that's it, so all in all 4 calls. Would you agree to that?
>
>
> yes, except that we don't need the drvrTXSupport() function as we can use
> dbi_driver_cap_get() instead.

I'll see if I can dig a bit into the code within the next couple of days.

Thanks!
Rainer

--
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!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2012-11-20 Thread Markus Hoenicka
Rainer Gerhards  was heard to say:

> That's what I would expect. However, I think it would be useful to
> have a call like "drvrTXSupport()" returning 1 if the driver supports
> transaction and 0 otherwise. That way, an app could either fall back
> to non-transcation mode OR tell the user that the database system is
> not suitable for that kind of application. That would probably also
> provide a smooth migration path, were only the primary TX interface
> needs to be implemented and drivers can be upgraded as time permits
> (assuming that some drivers are maintained by external entities).

In fact, we already have a (not well documented) infrastructure for  
things like this in place. Every driver keeps a list of boolean  
"capabilities" which is merely a key-value list of whatever we think  
is useful or necessary. To date, only the "safe_dlclose" capability  
seems to be used, see e.g. dbd_initialize in  
libdbi-drivers/drivers/mysql/dbd_mysql.c. There is an internal  
function _dbd_register_driver_cap() which can be used by the drivers  
to announce a capability. And there is a public function  
dbi_driver_cap_get() which allows applications to query the list of  
capabilities at runtime. So all we'd have to do is modify the drivers  
and have them add a "transaction_support" capability set to 1 for  
those who support transactions.

>
> For TX support, I'd expect calls for
>
> - begin transaction
> - commit
> - rollback
>
> that's it, so all in all 4 calls. Would you agree to that?

yes, except that we don't need the drvrTXSupport() function as we can  
use dbi_driver_cap_get() instead.

>
>> This should be easy to retrofit. I'lls see if I find
>> some time but feel free to beat me at it.
>
> I am quite busy myself at the moment, but I could try and see if I
> could craft something along that path...
>
> Rainer

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38



--
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!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2012-11-20 Thread Rainer Gerhards
On Tue, Nov 20, 2012 at 11:51 AM, Markus Hoenicka
 wrote:
> not exceptionally dumb, but rather touching a sensitive issue. I've
> used simple wrappers in one of my applications that could easily be
> moved into libdbi. I think a transaction interface has been missing
> from libdbi because some database engines that were supported in the
> days of yore did not have transaction support.

Ah! At least this explains.

> I think most database
> engines which are supported or have experimental support these days
> support transactions by sending queries along the lines of "begin" or
> "begin work" etc.

That's what I would expect. However, I think it would be useful to
have a call like "drvrTXSupport()" returning 1 if the driver supports
transaction and 0 otherwise. That way, an app could either fall back
to non-transcation mode OR tell the user that the database system is
not suitable for that kind of application. That would probably also
provide a smooth migration path, were only the primary TX interface
needs to be implemented and drivers can be upgraded as time permits
(assuming that some drivers are maintained by external entities).

For TX support, I'd expect calls for

- begin transaction
- commit
- rollback

that's it, so all in all 4 calls. Would you agree to that?

> This should be easy to retrofit. I'lls see if I find
> some time but feel free to beat me at it.

I am quite busy myself at the moment, but I could try and see if I
could craft something along that path...

Rainer

--
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!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


Re: [libdbi-users] libdbi transaction support

2012-11-20 Thread Markus Hoenicka
Rainer Gerhards  was heard to say:

> Hi all,
>
> sorry if this is an exceptionally dumb question, but: does libdbi
> support transactions (and, if so, via which functions)? I tried to
> find the transaction support functions, but did not come up with
> anything. Also a (granted, quick) look at the source did not tell me
> anything.
>
> Any help is deeply appreciated,
> Rainer
>

Hi,

not exceptionally dumb, but rather touching a sensitive issue. I've  
used simple wrappers in one of my applications that could easily be  
moved into libdbi. I think a transaction interface has been missing  
from libdbi because some database engines that were supported in the  
days of yore did not have transaction support. I think most database  
engines which are supported or have experimental support these days  
support transactions by sending queries along the lines of "begin" or  
"begin work" etc. This should be easy to retrofit. I'lls see if I find  
some time but feel free to beat me at it.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38



--
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!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users