DBI-BabyConnect

 view release on metacpan or  search on metacpan

configuration/dbconf/globalconf.pl  view on Meta::CPAN

# that do persistence using Apache, as the mechanism of rollback is carried externally of Apache
# handlers and is being dispatched within the DBI::BabyConnect object itself.
ON_FAILED_DBIEXECUTE_ROLLBACK_AND_EXIT=1

# The following is not used
#FORCE_UPPERCASE_ON_ATTRIBUTES

# When ENABLE_STATISTICS_ON_DO is set to 1, a DBI::BabyConnect object maintains
# a table to hold statistics about the do()'s requested by identifying each entry
# with the query string being passed to the do() method. The programmer can
# then call get_do_stat() to get the object that hold the statistics.
# Do not enable this unless you need to collect statistics, for instance in
# data warehousing environment the queries to do() are limited in format
# and are time consuming, so you may desire to collect statistics about these
# do()'s queries.
# 
ENABLE_STATISTICS_ON_DO=0

# When ENABLE_STATISTICS_ON_SPC is set to 1, a DBI::BabyConnect object maintains
# a table to hold statistics about the spc()'s requested by identifying each entry
# with the stored procedure name passed to the spc() method. The programmer can
# then call get_spc_stat() to get the object that hold the statistics.
# Do not enable this unless you need to collect statistics, for instance in
# data warehousing environment the stored procedure names passed spc() are limited in number
# and are time consuming, so you may desire to collect statistics about these
# spc()'s stored procedures.
ENABLE_STATISTICS_ON_SPC=0

lib/DBI/BabyConnect.pm  view on Meta::CPAN

When inserting new data, a scalar that refers to an empty string "" will normally
keep the default value of the attribute in the database, i.e. NULL. You can
set DBSETTING_FORCE_SINGLESPACE_FOR_EMPTY_STRING=1 to force the writing of
a single space instead of keeping the default NULL.

=head2 ENABLE_STATISTICS_ON_DO

When ENABLE_STATISTICS_ON_DO is set to 1, a DBI::BabyConnect object maintains
a table to hold statistics about the L<"do">'s requested by identifying each entry
with the query string being passed to the L<"do"> method. The programmer can
then call get_do_stat() to get the object that hold the statistics.
Do not enable this unless you need to collect statistics, for instance in
data warehousing environment the queries to do() are limited in format
and are time consuming, so you may desire to collect statistics about these
do()'s queries.


=head2 ENABLE_STATISTICS_ON_SPC

When ENABLE_STATISTICS_ON_SPC is set to 1, a DBI::BabyConnect object maintains
a table to hold statistics about the spc()'s requested by identifying each entry
with the stored procedure name passed to the spc() method. The programmer can
then call get_spc_stat() to get the object that hold the statistics.
Do not enable this unless you need to collect statistics, for instance in
data warehousing environment the stored procedure names passed spc() are limited in number
and are time consuming, so you may desire to collect statistics about these
spc()'s stored procedures.


=head1 Database Descriptors File

The databases.pl file holds a set of database descriptors. The database descriptor
is an object whose attributes describe a specific connection to a data source, that is

lib/DBI/BabyConnect.pm  view on Meta::CPAN


The printing is in HTML format, therefore you need to use this function from a Perl script
that is served under Apache. For an example, see any of the following scripts
eg/perl/testbaby.pl, eg/perl/testcache.pl, or eg/perl/onemore.pl.

See L<"getStatCC"> for description of this the cached statistical table of DBI::BabyConnect
objects.

=head2 get_do_stats 

 This method get_do_stat() takes one optional argument:
 - if you do not pass any argument, then this method will return a string containing the statistics collected
 - if you pass a hash reference as the first argument then the do()'s statistics table is copied to this hash reference
   and the method will also return the reference to that hash
 - if you pass anything else (as a string), then the method will return a hash reference containing the statistics collected
   on the do() query that match that string.

get_do_stat() returns the statistics collected on the do() method. You should have
enabled to collect the statistics by seting L<"ENABLE_STATISTICS_ON_DO"> to 1, otherwise
the statictics table is empty.
Before setting ENABLE_STATISTICS_ON_DO to 1, just know what you are doing otherwise
you will imply a huge penalty on the DBI::BabyConnect object by acquiring an unecessary
data structure to hold the statistics of all do()'s statement. Refer to the section
L<"ENABLE_STATISTICS_ON_DO">.

I added the ENABLE_STATISTICS_ON_DO for some system integrators working in data warehouse,
where the do() robots are usually repetitive for the same set of queries and are time consuming.
If your do() query is taking too long, and your do() queries are limited in number, and
you want to know how many time the same query is being called (and how much system time it is
consuming) then enable ENABLE_STATISTICS_ON_DO, and use the method get_do_stat() to get the
statistics of all your do()'s that have been invoked by a DBI::BabyConnect object.

=head2 get_spc_stats 

Similar to L<"get_do_stats"> but statistics are collected on Stored Procedures whenever
you call spc().

=head1 Database Status and Schema

DBI::BabyConnect provides several functions that can request meta data and schema



( run in 0.534 second using v1.01-cache-2.11-cpan-49f99fa48dc )