[Dbix-class] Setting LongReadLen for catalyst session

John Napiorkowski jjn1056 at yahoo.com
Wed Aug 29 03:55:58 GMT 2007


--- Jason Gottshall <jgottshall at capwiz.com> wrote:

> My Catalyst session table uses a CLOB field (Oracle)
> to store the
> session data, so at some point I need to set
> $dbh->{LongReadLen} to a
> reasonable value. I found a place in
> Catalyst::Plugin::Session::Store::DBIC where I can
> check for a config
> value and set LongReadLen locally. Here's a diff -u:
> 
>   --- DBIC.pm 2006-09-16 15:36:27.000000000 -0400
>   +++ DBIC_new.pm 2007-08-28 14:47:40.000000000
> -0400
>   @@ -191,6 +191,20 @@
>        return ($accessor, @args);
>    }
>   
>   +=head2 get_session_data
>   +
>   +Retrieve the specified session from the backend
> store, setting
>   +$dbh->{LongReadLen} according to the C<maxlength>
> value in config.
>   +
>   +=cut
>   +
>   +sub get_session_data {
>   +    my ( $c, $key ) = @_;
>   +    local
>
$c->session_store_delegate->model->result_source->storage->dbh
>   +        ->{LongReadLen} =
> $c->config->{session}->{maxlength} || 0;
>   +    return $c->NEXT::get_session_data($key);
>   +}
>   +
>    =head2 delete_session_data
>   
>    Delete the specified session from the backend
> store.
> 
> Any thoughts? Is the plugin maintainer on this list,
> or should I
> cross-post to the Catalyst list?
> 
> Thanks,
> Jason

Jason,

Offtopic from your post, but if you are interested in
helping me fillout DBIC's support of BLOB types I
would appreciate your assistance and thoughts.  DBIC
can now specify a parameter bind type which I have
found with Postgresql (and in my experience with older
versions of Oracle several years ago) to be the key to
supporting this long types for some of the databases
that are a bit fussy about them.

I'd be careful with LongReadLen, since I found that
setting this high can have a tremendous performance
impact, at least on the version of Oracle 8 that I was
using 4 years ago.  Maybe they solved that now, or
maybe you know a way around it, just pointing it out
since your session gets hit for each and every
request.

If you wanted to help with the above mentioned,
there's not a lot of work on it, just helping me to ID
the correct type names which should map to an Oracle
type constant and help write some tests for it.  Then
you won't have to muck about with longreadlen and also
help others that have similar trouble.

Thanks!
John Napiorkowski


       
____________________________________________________________________________________Ready for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/



More information about the DBIx-Class mailing list