-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Sep 01, 2006 at 04:35:38PM -0400, dhaval gada wrote:
> Hi,
>  I am not using any references to subroutines in the session data.
> 
> And if some objects are implemented in Perl as references to subroutines,
> and
> some data structures include also subroutine references,
> then does it imply that no session management is possible with objects in
> embperl ???????????????

In fact, a DBI handle has some code refs in its bowels. n example would
be, for a DBI handle $h, $h->{HandleError}, a user-settable error
handler func.

Many complex objects (in Perl and otherwise) have such things, they are very
useful.

But there are more reasons not to stash a DBI in a session. Note that
you "freeze" this object in a process to be thawed in another. Some
languages support even the freezing of bits of code (with all their
context, wich isn't trivial!), to thaw them elsewhere -- but consider
for example the raw database handle, which at the lowest level is just a
file descriptor through which your app is talking to a database server:
this file handle has only meaning in the one application instance and in
the other it will be most probably a meaningless number (or worse: the
database server process will get very confused when two application
instances talk to it through the same open file descriptors).

The upshot is: *be very careful with what you put into a session stash*,
not everything will have the same meaning when you pull it out.

Sometimes (as in this case) some logic is in place to keep you from
shooting yourself in the foot. Lucky you ;-)

I'd recommend you read something up on Perl object oriented things. The
manual page perlootut is a good start. The Perl book (known as the Camel
Book) is a good read too. And Damian Conway's "Object Oriented Perl"
might find a place in your bookshelf too.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFE+R1kBcgs9XrR2kYRAms/AJ45Rn0KqnivWp6Z1NE4Nq0VIHp+FACeNtuU
vVLlxH+PX2sjuuG/Nsm8qVE=
=cyIW
-----END PGP SIGNATURE-----

Reply via email to