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
SPOPS::Key::DBI::Pool(3) User Contributed Perl Documentation SPOPS::Key::DBI::Pool(3)

SPOPS::Key::DBI::Pool -- Retrieves ID field information from a pool

 # In your configuration file

 # Bind the value 'unique_value' to the field 'table'

 my $spops = {
   isa => [ qw/ SPOPS::Key::DBI::Pool SPOPS::DBI / ],
   pool_sql   => 'select my_key from key_pool where table = ?',
   pool_value => [ 'unique_value' ],
   ...
 };


 # Use the values 'unique_value' and 'my_location' but use quoting
 # rather than binding (some DBDs don't let you use bound values with
 # stored procedures)

 my $spops = {
   isa => [ qw/ SPOPS::Key::DBI::Pool SPOPS::DBI / ],
   pool_sql   => 'exec new_key %s, %s',
   pool_value => [ 'unique_value', 'my_location' ],
   pool_quote => 1,
   ...
 };

This module retrieves a value from a pool of key values matched up to tables. It is not as fast as IDENTITY fields (SPOPS::Key::DBI::Identity, auto_incrementing values or sequences, but can be portable among databases and, most importantly, works in a replicated environment. It also has the benefit of being fairly simple to understand.

Currently, the key fetching procedure is implemented via a stored procedure for portability among tools in different languages, but it does not have to remain this way. It is perfectly feasible to program the entire procedure in perl.

Put this class before others in ISA

Not really a bug, but you must put this class before any database-specific ones (like 'SPOPS::DBI::Sybase' or whatnot) in your @ISA, otherwise this class will not be able to do its work.

It might be a good idea to subclass this with a pure Perl solution.

Copyright (c) 2001-2004 intes.net, inc.. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Chris Winters <chris@cwinters.com>
2004-06-02 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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