Re: [Libdbi-drivers-devel] libdbi oracle ocilib

2008-11-11 Thread Markus Hoenicka
vincent rogier writes:
  For the cleanup function, it's not an oligation but would be nice ! At the
  moment i hold a counter to call the initialization and cleanup functions in
  the libdbi connect and disconnect functions.
  

As per your request I've added a dbd_finalize() function to all
drivers which is called from libdbi just before the driver is
dlclose()'d. This usually happens when an instance (new interface) or
the library (old interface) is shut down. The dbd_finalize() function
is the proper place to do any cleanup in the client libraries. I've
noted that the ingres driver has a FIXME note saying it would require
such a shutdown. I'd appreciate if the ingres maintainer could add the
required code to do so.

The current cvs revision of libdbi-drivers (1.0-pre2) which has these
changes requires the current cvs revision of libdbi (also
1.0-pre2). Let me know if there are any problems.

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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Libdbi-drivers-devel mailing list
Libdbi-drivers-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel


Re: [Libdbi-drivers-devel] libdbi oracle ocilib

2008-10-16 Thread vincent rogier
Hi markus,

About, the fact that libdbi has to know the number of rows in resultset
before fetching data :

* Oracle 8i can't do it. So Oracle 8i won't be supported. Even if Oracle 8i
is nor even supported anymore by Oracle (except for some big clients),
Oracle is still widely used...
* Oracle  9i can handle it but it will affect performances

But let's forget Oracle case for now. If you've got a big resultset (let's
say 1.000.000 rows) that has 20 columns with some string based columns
(let's say 3.000 bytes per row).
Actual implementation of libdbi allocates memory for all resultset rows.
With this example, it makes 3Go that have to be allocated !!! Just to fetch
a query... with ocilib, for example, by default, only 60Ko would be
allocated...

I think preallocating space for all resultset rows  is a constraint when
dealing with big resultset and whatever is the database server, libdbi would
get better performances if you could handle differently.

The ocilib based libdbi oracle drivers is now done and i'm making the last
tests.

For the cleanup function, it's not an oligation but would be nice ! At the
moment i hold a counter to call the initialization and cleanup functions in
the libdbi connect and disconnect functions.

I'll have a look at the new test case.

Vincent.

2008/10/16 Markus Hoenicka [EMAIL PROTECTED]

 [I've cc'ed the list as other Oracle users may be interested - please send
 your replies to the list too]

 Quoting vincent rogier [EMAIL PROTECTED]:

  hi,

 just to let you know that the current oracle can't even compile !! a
 variable not declared in dbd_oracle, line 866.. it can fixed just by
 returning directly the result of mktime()...


 Once again, unfortunately I can't even compile the driver as I don't have
 the oracle libs installed.

  I think you rellay should think about doing something for the number or
 row
 problem... Because it not only a problem for oracle but as well for
 firebird
 and other sgdb...


 I'm open to creative solutions for this problem. I can't think of one right
 now.


 For oracle, we can handle that limitation only for Oracle = Oracle 9i but
 the performance will decreased


 Isn't 10 the current version? If yes, I wouldn't favour rewriting libdbi in
 order to support Oracle's next-to-last release.

  Another thing.. libdbi has dbd_initialize() but i did'nt find a
 finalization/cleanup function... why ?

 For ocilib, i have a OCI_Initiliaze() and OCI_Clean() if libdbi does
 not
 have a cleanup function, it means the driver wil initialize ocilib at
 every
 connection and cleanup at every disconnection.. hum. not really
 optimized...


 I suspect that none of the other client libraries has any need for cleanup.
 Afaik this is at least the case for mysql, pgsql, sqlite, and firebird. If
 an ocilib-based driver needs a cleanup function, we can easily retrofit one
 for the next major (that is, with API changes) release. This would then be a
 dummy function for all other drivers. The best place to call this cleanup
 function is probably when you shut down an instance (or libdbi when using
 the old interface), as libdbi unloads all drivers in turn anyway.


 regards,
 Markus


 --
 Markus Hoenicka
 [EMAIL PROTECTED]
 (Spam-protected email: replace the quadrupeds with mhoenicka)
 http://www.mhoenicka.de




-- 
Vincent Rogier
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Libdbi-drivers-devel mailing list
Libdbi-drivers-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel


Re: [Libdbi-drivers-devel] libdbi oracle ocilib

2008-10-16 Thread Kjell Irgens
vincent rogier wrote:

 But let's forget Oracle case for now. If you've got a big resultset 
 (let's say 1.000.000 rows) that has 20 columns with some string based 
 columns (let's say 3.000 bytes per row).
 Actual implementation of libdbi allocates memory for all resultset rows. 
 With this example, it makes 3Go that have to be allocated !!! Just to 
 fetch a query... with ocilib, for example, by default, only 60Ko would 
 be allocated...

Shouldn't you be using cursors when you have result sets of this size? 
I am no SQL expert, but I saved huge amounts of memory when I started 
using cursors in a setting like this.  But then again, maybe this would 
not have been necessary if libdbi worked differently.

-- 
--Kjell

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Libdbi-drivers-devel mailing list
Libdbi-drivers-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel