github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

theory / dbix-connector

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 9
    • 5
  • Source
  • Commits
  • Network (5)
  • Issues (0)
  • Downloads (6)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (6)
    • v0.31
    • v0.30
    • v0.20
    • v0.12
    • v0.11
    • v0.10
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Fast, safe DBI connection management — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Updated email for Peter Rabbitson. 
theory (author)
Tue Feb 02 10:03:04 -0800 2010
commit  bfc3f01e64a9c3d4b8af3d5d6176c03132f1ef15
tree    a2e1adfe2823239be07bfe98b8f7f8babe42ea52
parent  cd1552efc525de210d91cad516756eb01258a7b0
dbix-connector /
name age
history
message
file .gitignore Loading commit data...
file Build.PL
file Changes
file MANIFEST.SKIP
file README
directory lib/
directory t/
README
DBIx/Connection version 0.32
============================

DBIx::Connector provides a simple interface for fast and safe DBI connection
and transaction management. Connecting to a database can be expensive; you
don't want your application to re-connect every time you need to run a query.
The efficient thing to do is to hang on to a database handle to maintain a
connection to the database in order to minimize that overhead. DBIx::Connector
lets you do that without having to worry about dropped or corrupted
connections.

You might be familiar with Apache::DBI and with the DBI's `connect_cached()`
constructor. DBIx::Connector serves a similar need, but does a much better
job. How is it different? I'm glad you asked!

DBIx::Connector provides a simple interface for fast and safe DBI connection
and transaction management. Connecting to a database can be expensive; you
don't want your application to re-connect every time you need to run a query.
The efficient thing to do is to hang on to a database handle to maintain a
connection to the database in order to minimize that overhead. DBIx::Connector
lets you do that without having to worry about dropped or corrupted
connections.

You might be familiar with Apache::DBI and with the DBI's `connect_cached()`
constructor. DBIx::Connector serves a similar need, but does a much better
job. How is it different? I'm glad you asked!

* Fork Safety

  Like Apache::DBI, but unlike `connect_cached()`, DBIx::Connector will return
  a new database handle if a new process has been `fork`ed. This happens all
  the time under mod_perl, in POE> applications, and elsewhere.

* Thread Safety

  Unlike Apache::DBI or `connect_cached()`, DBIx::Connector will return a new
  database handle if a new thread has been spawned. As with `fork`ing,
  spawning a new thread can break database connections.

* Works Anywhere

  Unlike Apache::DBI, DBIx::Connector runs anywhere -- inside of mod_perl or
  not. Why limit yourself?

* Explicit Interface

  DBIx::Connector has an explicit interface. There is none of the magical
  action-at-a-distance crap that Apache::DBI is guilty of, and no global
  caching. I've personally diagnosed a few issues with Apache::DBI's magic,
  and killed it off in two different applications in favor of
  `connect_cached()`, only to be tripped up by other gotchas. No more.

* Optimistic Execution

  If you use `run()` and `txn()`, the database handle will be passed without
  first pinging the server. For the 99% or more of the time when the database
  is just there, you'll save a ton of overhead without the ping.

DBIx::Connector's other feature is transaction management. Borrowing from
DBIx::Class, DBIx::Connector offers an interface that efficiently handles the
scoping of database transactions so that you needn't worry about managing the
transaction yourself. Even better, it offers an interface for savepoints if
your database supports them. Within a transaction, you can scope savepoints to
behave like subtransactions, so that you can save some of your work in a
transaction even if some of it fails.

INSTALLATION

To install this module, type the following:

    perl Build.PL
    ./Build
    ./Build test
    ./Build install

Dependencies
------------

DBIx::Connection requires DBI 1.605 or higher.

Copyright and Licence
---------------------

Copyright (c) 2009 David E. Wheeler. Some Rights Reserved.

This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server