• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/POE/Component/H18-Jul-2004-2,8981,412

t/H18-Jul-2004-3,6753,256

ChangeLogH A D24-Aug-20022.3 KiB6448

ChangesH A D24-Aug-2002180 74

MANIFESTH A D27-Mar-2004736 3938

MANIFEST.SKIPH A D15-Oct-200254 76

META.ymlH A D18-Jul-2004403 1311

Makefile.PLH A D03-May-20224.1 KiB205166

READMEH A D24-Aug-20023.5 KiB8965

README

1POE/Component/LaDBI version 1.0
2================================
3
4POE::Component::LaDBI is a POE Component to allow for non-blocking
5access to most of the DBI API. Each LaDBI component session started
6spawns a sub-process which it communicates with via POE::Wheel::Run.
7Multiple DBI database handles can be created in the sub-process, but
8withing the sub-process DBI calls will still block.
9
10If you wish to use two DBI database handles in a non-blocking manner
11at the same time, you will need to instantiate two or more LaDBI
12components. POE::Component::LaDBI could be enhanced to map different
13DBI database handles to separate sub-processes with POE::Wheel::Run.
14However, I chose not to engage the complexity of that implementation.
15
16The client sessions can post events to the POE::Component::LaDBI
17session using it's alias which is 'ladbi' by default. Or you can
18specify your own alias when you call POE::Component::ladbi->create().
19Of course, if you need multiple LaDBI components, you will need to set
20them up with separate aliases.
21
22The 'connect' and 'prepare' LaDBI events will return a uniquely
23identifying ID. This is a generated string and should only be used as
24an opaque cookie to refer to the appropriate database or statement
25handle in the sub-process.
26
27All the data from the DBI calls will be passed to the client event
28specified in the post to the LaDBI session. The data is always
29returned as a scalar. This scalar is a number, a string, or a reference
30to a more complex data stucture. While DBI has separate calls to return
31arrays versus arrayrefs, LaDBI only has events which return references
32to arrays or hashes.
33
34
35INSTALLATION
36
37To install this module type the following:
38
39   perl Makefile.PL
40   make
41   make test
42   make install
43
44When you call 'perl Makefile.PL', you will be prompted with some
45questions. The first is whether you want to test this module against a
46database. If you really want to test this module you will need to answer
47'yes'. Otherwise, the only test will be whether the modules load
48properly with use; all others will be skipped.
49
50If you choose to test POE::Component::LaDBI against a database, you will
51need to specify the DSN (Data Source Name?), a username, and a password
52for that user. The DSN is the same data source value you would pass
53to a regular DBI->connect() call. The DSN needs to specify a database for
54which the username has the rights to create a table, insert into a table,
55and delete the table. The default table name will be 'ladbi_test'. If you
56need to change the table name edit the $TEST_TABLE variable in the
57'ladbi_config.pl' file.
58
59After answering 'yes' to the "do you want to test against a database"
60question, you will be prompted for the DSN, USERNAME, and PASSWORD.
61
62When the tests are run they will output diagnostic info to a file named
63'test.log'. You can 'tail -f test.log' to track the progress of the
64tests. If you really want to see what is happening between the LaDBI
65session and the sub-process you can turn on debugging for the
66sub-process. To do this set the environment variable LADBI_DEBUG=1
67before you run 'make test'. This will create a separate debug output
68file called 'ladbi_run.log'.
69
70
71DEPENDENCIES
72
73POE::Component::LaDBI requires Perl v5.6.0 or newer. I use Perl v5.6.0
74constucts, and don't want to code using features specified as obsolete.
75
76This module requires these other modules and libraries:
77
78Data::Dumper
79POE v0.18
80DBI v1.20
81
82
83COPYRIGHT AND LICENCE
84
85Put the correct copyright and licence information here.
86
87Copyright (C) 2002 Sean M. Egan
88
89