Re: [libdbi-users] Feedback and Questions [resend]
I just got access the an MS SQL v8 engine. I tried make check with the official 0.8.3 tarball. Unfortunately, there seem to be some issues (below). Please note that make check asked me for the database version. The problem below appeared when I entered nothing. When I entered 8.00.76, make check could not connect. All in all, I don't know what I need to provide as the version, so maybe this is where the problem is ;) Rainer Driver information: --- Name: freetds Filename: /usr/local/lib/dbd/libdbdfreetds.so Desc: MS SQL and Sybase databases support (using libct) Maintainer: Vadym Kononenko <[EMAIL PROTECTED]> URL:http://libdbi.sourceforge.net Version:dbd_freetds v0.8.3 Compiled: Feb 18 2008 Successfully connected! Using database engine version 80076 (numeric) and 8.00.76 (string) Test 1: List databases: Got result, try to access rows Adiscon AdisconTest EventsManager EventsManagerBkp hoey intranet master model msdb MW_DSHS Northwind pubs rsyslog tempdb test Test 2: Create database libdbitest using default encoding: libdbi: [queryf] CREATE DATABASE libdbitest Ok. Test 3: Select database: Ok. Test 4: Get encoding: The database encoding appears to be: (null) Test 5: Create table: libdbi: [query] CREATE TABLE test_datatypes ( the_char TINYINT,the_uchar TINYINT,the_short SMALLINT,the_ushort SMALLINT,the_long INT,the_ulong INT,the_longlong BIGINT,the_ulonglong BIGINT,the_float REAL,the_double FLOAT,the_driver_string VARCHAR(255),the_conn_quoted_string VARCHAR(255),the_conn_quoted_string_copy VARCHAR(255),the_conn_escaped_string VARCHAR(255),the_conn_escaped_string_copy VARCHAR(255),the_empty_string VARCHAR(255),the_null_string VARCHAR(255),the_binary_quoted_string IMAGE,the_binary_escaped_string IMAGE,the_datetime DATETIME,the_date DATETIME,the_time DATETIME,id INT IDENTITY,CONSTRAINT tr_test_datatypes PRIMARY KEY (id)) Ok. Test 6: List tables: Oops! Can't get table list! Error message: FAIL: test_dbi === 1 of 1 tests failed === > -Original Message- > From: [EMAIL PROTECTED] [mailto:libdbi-users- > [EMAIL PROTECTED] On Behalf Of Rainer Gerhards > Sent: Friday, February 15, 2008 10:29 PM > To: Markus Hoenicka; libdbi-users@lists.sourceforge.net > Subject: 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.
Re: [libdbi-users] Feedback and Questions [resend]
Just for those following this thread. I have posted a patch on the libdbi-devel mailing list. The new thread can be found here: http://sourceforge.net/mailarchive/forum.php?thread_name=1203169879.4757 .13.camel%40localhost.localdomain&forum_name=libdbi-devel Rainer > -Original Message- > From: [EMAIL PROTECTED] [mailto:libdbi-users- > [EMAIL PROTECTED] On Behalf Of Markus Hoenicka > Sent: Saturday, February 16, 2008 4:40 PM > To: libdbi-users@lists.sourceforge.net > Subject: Re: [libdbi-users] Feedback and Questions [resend] > > Rainer Gerhards writes: > > I suggest to add a "_r" prefix, e.g. dbi_initialize() becomes > > dbi_initialize_r(). I think this is in line with clib functions like > > strerror() and strerror_r(). While the actual code fix with > strerror() > > (renentrancy) is not 100% identical to what we see here, I think it > is > > sufficiently close to justify the naming. But of course, this are > just > > my personal thoughts... > > > > Fair enough from my point of view. It's rather "recallable" than > "reentrant", but this still makes an "_r"... > > > One thought on "deprecated" from my very limited point of view. I > see > > they are good to tell projects its time to upgrade. On the other > hand, > > there may be valid reasons to support both. For example, I intend to > > check the version number and use dbi_initialize() if we are 0.8.3.1 > or > > lower - because that works well enough with my application in its > > current state. And it is better to use what is there then to deny > > functionality. After all, the user may be unable to compile a > package > > himself and so relies on whatever the distro provides - and that may > be > > an older release. Of course, I can issue a warning message in that > case, > > so that the more knowledgeable user can update. The bottom line is > that > > with that logic, the "deprecated" message will always spoil my build > > log, which is a cosmetic issue but still not nice ;) > > > > I see one of the main effects of "deprecated" messages to prevent the > use of these functions in *new* code, which works best by violating > the aesthetics of the developers :-) If package maintainers do their > job, the "deprecated" messages will eventually go away also for those > users that prefer packaged code - its all a matter of time. > > 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]
Rainer Gerhards writes: > I suggest to add a "_r" prefix, e.g. dbi_initialize() becomes > dbi_initialize_r(). I think this is in line with clib functions like > strerror() and strerror_r(). While the actual code fix with strerror() > (renentrancy) is not 100% identical to what we see here, I think it is > sufficiently close to justify the naming. But of course, this are just > my personal thoughts... > Fair enough from my point of view. It's rather "recallable" than "reentrant", but this still makes an "_r"... > One thought on "deprecated" from my very limited point of view. I see > they are good to tell projects its time to upgrade. On the other hand, > there may be valid reasons to support both. For example, I intend to > check the version number and use dbi_initialize() if we are 0.8.3.1 or > lower - because that works well enough with my application in its > current state. And it is better to use what is there then to deny > functionality. After all, the user may be unable to compile a package > himself and so relies on whatever the distro provides - and that may be > an older release. Of course, I can issue a warning message in that case, > so that the more knowledgeable user can update. The bottom line is that > with that logic, the "deprecated" message will always spoil my build > log, which is a cosmetic issue but still not nice ;) > I see one of the main effects of "deprecated" messages to prevent the use of these functions in *new* code, which works best by violating the aesthetics of the developers :-) If package maintainers do their job, the "deprecated" messages will eventually go away also for those users that prefer packaged code - its all a matter of time. 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
Re: [libdbi-users] Feedback and Questions [resend]
> > 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 > > The functions dbi_initialize(), dbi_shutdown(), > dbi_driver_list(), and dbi_driver_open() access rootdriver. All of > these can easily be modified to accept the sentinel as an additional > parameter. I suggest to add a "_r" prefix, e.g. dbi_initialize() becomes dbi_initialize_r(). I think this is in line with clib functions like strerror() and strerror_r(). While the actual code fix with strerror() (renentrancy) is not 100% identical to what we see here, I think it is sufficiently close to justify the naming. But of course, this are just my personal thoughts... > > 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 > > This is how we handled most incompatible changes in the past. The old > functions were usually labelled as "deprecated", but in fact most of > them are still around. We'll just have to find suitable names for the > additional functions. One thought on "deprecated" from my very limited point of view. I see they are good to tell projects its time to upgrade. On the other hand, there may be valid reasons to support both. For example, I intend to check the version number and use dbi_initialize() if we are 0.8.3.1 or lower - because that works well enough with my application in its current state. And it is better to use what is there then to deny functionality. After all, the user may be unable to compile a package himself and so relies on whatever the distro provides - and that may be an older release. Of course, I can issue a warning message in that case, so that the more knowledgeable user can update. The bottom line is that with that logic, the "deprecated" message will always spoil my build log, which is a cosmetic issue but still not nice ;) > > > 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. > > > > Patches are more than welcome. Feel free to send them at your earliest > convenience. I'll see what I can put together :) Rainer - 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]
Hi Toby, > -Original Message- > From: Toby Thain [mailto:[EMAIL PROTECTED] > Sent: Saturday, February 16, 2008 12:36 AM > To: Rainer Gerhards > Cc: libdbi-users@lists.sourceforge.net; libdbi-drivers- > [EMAIL PROTECTED] > Subject: Re: [libdbi-users] Feedback and Questions [resend] > I contributed the Ingres 2006 driver. In my tests it has worked well > (though I don't use it in production myself). Glad to hear that :) > I am not sure whether to infer from your question that you actually > plan to use it, but I am attentive to this list if anyone has > problems with it. I guess my situation is similar to yours - I do not have Ingres myself. I implemented libdbi for my users, which may want to use a variety of databases to store syslog messages. I'd like to provide the broadest possible support and that is what made libdbi so appealing to me. So I, too, need to stay back and wait for user feedback. If I get something, I'll post it over here. Rainer - 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]
On 15-Feb-08, at 4:06 AM, Rainer Gerhards wrote: > ... > A second question is on the status of the Ingres/mSQL and Oracle > drivers. ... > 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). ... Hi Rainer, I contributed the Ingres 2006 driver. In my tests it has worked well (though I don't use it in production myself). I am not sure whether to infer from your question that you actually plan to use it, but I am attentive to this list if anyone has problems with it. regards --Toby - 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]
Rainer Gerhards writes: > 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 The functions dbi_initialize(), dbi_shutdown(), dbi_driver_list(), and dbi_driver_open() access rootdriver. All of these can easily be modified to accept the sentinel as an additional parameter. > 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 This is how we handled most incompatible changes in the past. The old functions were usually labelled as "deprecated", but in fact most of them are still around. We'll just have to find suitable names for the additional functions. > 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. > Patches are more than welcome. Feel free to send them at your earliest convenience. 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
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
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]
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
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
Re: [libdbi-users] Feedback and Questions [resend]
I just had a quick look at dbi_main.c. From my understanding, there is at least a memory leak when dbi_shutdown is called from the same instance (if called from within the same instance). In that case, the first dbi_initialize() driverlist is discarded (but not freed) by rootdriver = NULL. Once dbi_shutdown is called, things may (or may not) go wrong because of this freed memory (and the change in the driver list - I have not yet checked when it is accessed). The question is what the loader does. IMHO it depends on the platform. I can envision when you have a) rsyslog -> plugin_a ->dbi_initilize() b) rsyslog -> plugin_b ->dbi_initilize() There are instances where dbi is just loaded once into memory, with a single static memory pool (in fact my *uneducated* guess is that that would happen on most platforms. Then, we have the problem outlined above and can get into all sorts of nice troubles. Of course, if each instance receives its fresh dlloaded libdbi, everything should work really well. 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. Just some thoughts... Rainer > -Original Message- > From: [EMAIL PROTECTED] [mailto:libdbi-users- > [EMAIL PROTECTED] On Behalf Of Rainer Gerhards > Sent: Friday, February 15, 2008 6:27 PM > To: Markus Hoenicka; libdbi-users@lists.sourceforge.net > Subject: Re: [libdbi-users] Feedback and Questions [resend] > > > > Would rsyslog be suitable to run such a test, e.g. by > > > loading the output plugin and another (maybe renamed) copy of the > > same > > > plugin? This is an interesting problem also for other projects > which > > > use a plugin system and libdbi. > > > > I can do that with rsyslog. Actually, I just need to remove an if() > > that > > guards multiple instances from my plugin to call libdbi init more > than > > once. I'll try to do that Monday. Let you know the results when I > have > > them. It will probably not a very in-depth test, but at least it can > > provide some idea of how things happen to work. > > OK, I did a quick test using what I proposed. That worked fine (aka "no > crashes and data inserted"). But, of course, it struck me that this was > different from your question. After all, it now was the same instance > that called dbi_initialize() twice. > > I'll now see that I create a copy of the plugin and rename it and then > try it again. That won't fit today, I fear ;) > > Rainer > > --- > -- > 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]
> > Would rsyslog be suitable to run such a test, e.g. by > > loading the output plugin and another (maybe renamed) copy of the > same > > plugin? This is an interesting problem also for other projects which > > use a plugin system and libdbi. > > I can do that with rsyslog. Actually, I just need to remove an if() > that > guards multiple instances from my plugin to call libdbi init more than > once. I'll try to do that Monday. Let you know the results when I have > them. It will probably not a very in-depth test, but at least it can > provide some idea of how things happen to work. OK, I did a quick test using what I proposed. That worked fine (aka "no crashes and data inserted"). But, of course, it struck me that this was different from your question. After all, it now was the same instance that called dbi_initialize() twice. I'll now see that I create a copy of the plugin and rename it and then try it again. That won't fit today, I fear ;) Rainer - 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]
Hi Markus, thanks for the quick reply, much appreciated. > > 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, > > Do you have any experimental data which indicate that there will be a > problem? No, this was so far just a theoretical thought. I so far saw no reason to back it with actual data. > I don't mean to claim that there is no problem, but I reckon > that both plugins, when linked to libdbi, would load the drivers > separately and maintain these copies separately. That is, you'll waste > some memory but the plugins and the loaded drivers should not > interfere. That sounds logical. > Would rsyslog be suitable to run such a test, e.g. by > loading the output plugin and another (maybe renamed) copy of the same > plugin? This is an interesting problem also for other projects which > use a plugin system and libdbi. I can do that with rsyslog. Actually, I just need to remove an if() that guards multiple instances from my plugin to call libdbi init more than once. I'll try to do that Monday. Let you know the results when I have them. It will probably not a very in-depth test, but at least it can provide some idea of how things happen to work. > > > 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). > > > > Unfortunately there is only rare and irregular feedback on the > non-core drivers. However, as "insert" statements are a prerequisite > to do anything useful with a driver, I'd suspect that these should > work ok. As for the database engines you mentioned, Ingres is the one > that was added last. I assume it supports basic functionality. Oracle > has been around a little longer, and there have been some bug reports > and patches in the past, so I'd also say it is going to work. I > can't recall any feedback about mSQL though, and I'm not sure if > anyone on this list is currently using it. As a rule of thumb you > may want to steer your users towards the core drivers (firebird, > mysql, pgsql, sqlite, sqlite3) and leave the other drivers as an > option that will require some end-user testing. Understood. It's basically what I am doing: http://www.rsyslog.com/doc-omlibdbi.html 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. Rainer - 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
[libdbi-users] Feedback and Questions [resend]
Rainer Gerhards writes: > 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, Do you have any experimental data which indicate that there will be a problem? I don't mean to claim that there is no problem, but I reckon that both plugins, when linked to libdbi, would load the drivers separately and maintain these copies separately. That is, you'll waste some memory but the plugins and the loaded drivers should not interfere. Would rsyslog be suitable to run such a test, e.g. by loading the output plugin and another (maybe renamed) copy of the same plugin? This is an interesting problem also for other projects which use a plugin system and libdbi. > 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). > Unfortunately there is only rare and irregular feedback on the non-core drivers. However, as "insert" statements are a prerequisite to do anything useful with a driver, I'd suspect that these should work ok. As for the database engines you mentioned, Ingres is the one that was added last. I assume it supports basic functionality. Oracle has been around a little longer, and there have been some bug reports and patches in the past, so I'd also say it is going to work. I can't recall any feedback about mSQL though, and I'm not sure if anyone on this list is currently using it. As a rule of thumb you may want to steer your users towards the core drivers (firebird, mysql, pgsql, sqlite, sqlite3) and leave the other drivers as an option that will require some end-user testing. 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
[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.5&view=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