GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  BIO::MAGETAB::UTIL::DBLOADER (3)

.ds Aq ’

NAME

Bio::MAGETAB::Util::DBLoader - A persistent storage class used to track Bio::MAGETAB object creation and insertion into a relational database.

CONTENTS

SYNOPSIS



 require Bio::MAGETAB::Util::Reader;
 require Bio::MAGETAB::Util::Persistence;
 require Bio::MAGETAB::Util::DBLoader;

 my $reader = Bio::MAGETAB::Util::Reader->new({
     idf => $idf
 });

 my $db = Bio::MAGETAB::Util::Persistence->new({
     dbparams => ["dbi:SQLite:$db_file"],
 });

 # If this is a new database, deploy the schema.
 unless ( -e $db_file ) {
     $db->deploy();
 }

 # Connect to the database.
 $db->connect();

 my $builder = Bio::MAGETAB::Util::DBLoader->new({
     database => $db,
 });

 $reader->set_builder( $builder );

 # Read objects into the database.
 $reader->parse();



DESCRIPTION

DBLoader is a Builder subclass which uses a relational database backend to track object creation, rather than the simple hash reference mechanism used by Builder. See the Persistence class and the Tangram module documentation for more information on supported database engines.

ATTRIBUTES

See the Builder class for documentation on the superclass attributes.
database The internal store to use for object lookups. This must be a Bio::MAGETAB::Util::Persistence object.

METHODS

See the Builder class for documentation on the superclass methods.

CAVEATS

Objects when modified are not automatically updated in the database. You should use the update method to do this (see METHODS in the Builder class). In particular, it is important to bear in mind that there are places in the Bio::MAGETAB model where relationships between objects are being maintained behind the scenes (this allows certain relationships to be navigable in both directions). When modifying these objects, you must also call update on their target objects to ensure the database is kept synchronized with the objects held in memory. For example:



 # SDRFRow to Nodes is a reciprocal relationship:
 my $row = $loader->create_sdrf_row({
    nodes => \@nodes,
 });

 # @nodes now know about $row, but the database doesnt know this:
 $loader->update( @nodes );

 # Similarly, with Edges and Nodes:
 my $edge = $loader->find_or_create_edge({
    inputNode  => $in,
    outputNode => $out,
 });

 # Again, $in and $out know about $edge, but the database does not:
 $loader->update( $in, $out );



KNOWN BUGS

When used with SQLite or MySQL (and possibly others), the Tangram modules incorrectly modify any select statements containing the ’%’ character, so that this character is replaced with ’%%’. This means that while values are correctly inserted into the database they are not retrieved correctly, and this may result in errors or duplicate entries when working with objects whose identifying fields contains a ’%’ character. See the Builder class for a discussion on object identity, and <http://rt.cpan.org/Public/Bug/Display.html?id=29133> for a possible quick fix for this Tangram bug.

SEE ALSO

Bio::MAGETAB::Util::Reader Bio::MAGETAB::Util::Builder Bio::MAGETAB::Util::Persistence

AUTHOR

Tim F. Rayner <tfrayner@gmail.com>

LICENSE

This library is released under version 2 of the GNU General Public License (GPL).
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 BIO::MAGETAB::UTIL::DBLOADER (3) 2013-01-13

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.