Re: [libdbi-users] libdbi transaction support
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
Zitat von Rainer Gerhards rgerha...@hq.adiscon.com: 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
Rainer Gerhards writes: This should be easy to retrofit. I'lls see if I findsome 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
[libdbi-users] Feedback and Questions [resend]
[I had mail troubles and are now re-sending this message. Hopefully it doesn't produce dulicates...] Hi there, I have just implemented libdbi in my rsyslog project (http://www.rsyslog.com). I wanted to provide some feedback and also post some questions ;) Rsyslog is a vastly enhanced modular syslogd. It provides a plugin-interface. I am using libdbi for database-ignorant writing of syslog records. This is done inside a rsyslog output plugin, which in itself is a slim code layer. If anybody is interested, a quick look can be found at its cvsweb: http://rsyslog.cvs.sourceforge.net/rsyslog/rsyslog/plugins/omlibdbi/omli bdbi.c?revision=1.5view=markup I would like to thank you for the nice piece of software. I was able to create the rsyslog plugin in roughly 3 hours and most of this time was spent on evaluating why it did load drivers with the Fedora 8 default packages. It turned out that the reason was that rsyslog dlloads its own plugin which than calls libdbi. I did an install from the most recent source and that fixed the problem. I have to admit I am still a bit concerned that this causes headaches to my users, but I guess this problem will disappear as the distros begin to pick up the most recent libdbi version. Now to the questions: As I said, rsyslog itself uses plugins. I have no control over who writes and loads which plugins (neither would I like to have to ;)). What happens if another (maybe not-yet-written) plugin also uses libdbi and ALSO calls dbi_initialize()? I guess this is not supported. If so, is there any way inside libdbi to handle that situation. Remember, I can not link the rsyslog core to libdbi, because that would pull in this dependency on any system that runs rsyslog as the default syslogd (currently fedora core 8, debian in discussion, others probably follow). A second question is on the status of the Ingres/mSQL and Oracle drivers. I hope it is OK to post here (it's a one-timer and I'd like to save me another mailing list subscription). I got the impression that at least the Oracle driver can be used in practice (I don't have any of these systems to verify). I would appreciate if you can provide my any advise that I can pass on to my users. rsyslog uses very few driver calls, it just opens the connection and then issues queries with insert statements. No query results are ever used or read. Thanks again for the nice software and I am looking forward to your replies. Rainer Gerhards - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users
Re: [libdbi-users] Feedback and Questions [resend]
It just appears to me that we must have MSSQL in our lab. I'll see that I get some machine next week and try the make check. Will post results, but probably not before mid-week. Rainer -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Markus Hoenicka Sent: Friday, February 15, 2008 6:53 PM To: libdbi-users@lists.sourceforge.net Subject: Re: [libdbi-users] Feedback and Questions [resend] Rainer Gerhards writes: I just notice that you don't list openTDS as a core driver. Any problems with that one. Or have you just overlooked it? I probably have an actual use case to run it against Sybase soon. core currently means that I can test it on one of my boxen :-) I do not have the means to test or modify the remaining drivers, and there were no volunteers lately that would run a make check using these drivers to turn them into core drivers. There are no known issues with the FreeTDS driver at this time, but I hesitate to include it into the list of actively supported drivers if there is no feedback. If you can run make check with the FreeTDS driver, or convince someone to do so, I'd greatly appreciate to see the results. regards, Markus -- Markus Hoenicka [EMAIL PROTECTED] (Spam-protected email: replace the quadrupeds with mhoenicka) http://www.mhoenicka.de -- --- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users
Re: [libdbi-users] Feedback and Questions [resend]
Markus, I had a somewhat deeper look at dbi_main now. I think four or five functions would need to be changed in the way you propose. However, as this is an interface change, the previous functions would need to remain as is (including the plugin problem). While I looked at the code, I think a few mutex lock/unlock calls would also make it thread-safe. That is not a big issue for me, as rsyslog allows plugins to run on a single thread, but it may be a benefit for other situations. If you like, I can try to apply a number of changes and provide a patch file for your review. Rainer -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Markus Hoenicka Sent: Friday, February 15, 2008 7:00 PM To: libdbi-users@lists.sourceforge.net Subject: Re: [libdbi-users] Feedback and Questions [resend] Rainer Gerhards writes: In any case, I suggest that a second call of dbi_initialize() inside the same instance should return an error state - sounds better than unpredictable behavior. Making it multi-init safe could IMHO easily be done by using one additional handle. I can't claim to be an expert at these issues, but I imagine that moving the sentinel of the driver list into the application linked against libdbi instead of implementing it as a static global variable might resolve this problem. dbi_initialize would then look somewhat like: dbi_driver_t* dbi_initialize(const char *driverdir, int* numdrivers); (dbi_driver_t may not be user-visible at this time, but you get the idea). I'll be happy to consider this change if it helps to make libdbi plugin-safe. regards, Markus -- Markus Hoenicka [EMAIL PROTECTED] (Spam-protected email: replace the quadrupeds with mhoenicka) http://www.mhoenicka.de -- --- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users