Re: [Catalyst] how to authenticate using database users

2009-03-20 Thread Karl Forner


 Actually, there is really no reason to rely on the database for this.



I absolutely disagree. There's an authentication mechanism already
implemented in SGBD so why on earth not use it.
Moreover if you want to benefit for logging features of SGBD like Oracle,
your users have to be logged using their own account,
 so the the connection to the DB not only implement the authentication, but
also provide this user connection.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] reconnecting the DB model using a different DB account

2009-03-11 Thread Karl Forner
On Wed, Mar 11, 2009 at 5:03 PM, Tomas Doran bobtf...@bobtfish.net wrote:

 Karl Forner wrote:

 The problem is that I get error messages
 [error] DBIx::Class::Storage::DBI::ensure_connected(): DBI Connection
 failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var  or PATH
 (Windows) and or NLS settings, permissions, etc.

 I have tried using directly the DBI dbh but with the same results.

 So you're saying if you just do this using DBI, you have the same issue?


Yes, if I write:
$c-model('DB')-storage-disconnect
then
my $newdbh = DBI-connect(@$current_connect_info);

I get the same error




 I don't think the Catalyst list is the place to get help on this one. You
 _may_ have more luck on the DBIC list, but if it happens in raw DBI, then
 you're better off talking to the maintainer of the DBD driver you're using,
 as the issue will be at that level.


ok, thanks I'll try that
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] reconnecting the DB model using a different DB account

2009-03-10 Thread Karl Forner
Hi all,

I'm trying to use DB authentication and afterwards using the DB user account
for subsequent DB queries.
To do so, in the Root::auto method, if the DB model is already connected
with another DB account, I disconnect it and try to reconnect it with
the new user and password.

I disconnect as follows :
$c-model('DB')-storage-disconnect

and I reconnect like this:
$c-model('DB')-storage-connect_info($current_connect_info);
$c-model('DB')-storage-ensure_connected;

The problem is that I get error messages
[error] DBIx::Class::Storage::DBI::ensure_connected(): DBI Connection
failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var  or PATH
(Windows) and or NLS settings, permissions, etc.

I have tried using directly the DBI dbh but with the same results.

Thanks for helping
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: loading data types from Oracle DB with DBIx::Class::Schema::Loader

2009-02-11 Thread Karl Forner
I believe I fixed the problem (cf my post bug found in and tentatively
fixed in DBIx::Class::Schema::Loader::DBI::Oracle::_tables_list in the dbix
mailing list).

Here's a copy :

 We had a problem because DBIx::Class::Schema::Loader did not get the
 column_info for our Oracle database : no data_types, is_nullable, default
 etc.. attributes were set.
 We traced the problem down to 
 DBIx::Class::Schema::Loader::DBI::Oracle::_tables_list,
 that changed the table names to lowercase.

 So just commenting the line  69 : $table = lc $table;
 seems to fix the problem.

 The test is either to call the _tables_list and check the table names,
 or to create a schema on a n oracle db using
 DBIx::Class::Schema::Loader::make_schema_at, and to check that the generated
 DBIx::Class objects have
 the column attributes such asdata_type,  default_value , is_nullable ,
 size etc...


 Here are some details:
 DBIx::Class::Schema::Loader $VERSION = '0.04004'
  perl, v5.8.8 built for i486-linux-gnu-thread-multi

 diff:
 --- Oracle.pm2009-02-11 13:35:08.0 +0100
 +++ Oracle.pm.fixed2009-02-11 13:35:04.0 +0100
 @@ -66,7 +66,7 @@
  $table =~ s/\w+\.//;

  next if $table eq 'PLAN_TABLE';
 -$table = lc $table;
 +# $table = lc $table; # removed by kf
  push @tables, $1
if $table =~ /\A(\w+)\z/;
  }

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] bug? in t/view_TT.t

2009-02-09 Thread Karl Forner
Hello,

I am using catalyst on ubuntu with perl 5.8.8.
The script t/view_TT.t generated by default fails:

*%prove -l lib t/view_TT.t*
t/view_TT1/1
#   Failed test 'use My::App::View::TT;'
#   at t/view_TT.t line 5.
# Tried to use 'My::App::View::TT'.
# Error:  Can't locate object method *path_to* via package My::App
at x/lib/My/App/View/TT.pm line 6.

The script has only one line:
BEGIN { use_ok 'MyApp::View::TT' }

If you take a look at *MyApp/My/App/View/TT.pm*, the problem seems to be
this line:
Serono::Gecko-path_to( 'root/src' ),

If you put 'use My::App' just before the BEGIN, it runs fine but launches
the whole catalyst server stuff.

So I suspect this is a bug.

P.S - my version of catalyst
..
| Catalyst::Plugin::ConfigLoader  0.17
|
| Catalyst::Plugin::Static::Simple  0.20
|
| CatalystX::ListFramework::Builder  0.39
|
''
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] loading data types from Oracle DB with DBIx::Class::Schema::Loader

2009-02-06 Thread karl . forner
Hello,

We are using catalyst with an Oracle database.
We are using DBIx::Class::Schema::Loader to create the DBIx::Class
interface,
with the following command; 
 ./myapp_create.pl model DB DBIC::Schema MyApp::Schema create=static
'dbi:Oracle:sid=BDBDEV;host=ch7ux002.x;port=1521' 'user' 'user' '{
AutoCommit = 0 }'

It seems that the data_types are not set, in contradiction with the
DBIx::Class documentation.

Anyone has a clue on how to automatically fecth the datatypes ? 

Thanks,


-
This message and any attachment are confidential, may be privileged
or otherwise protected from disclosure and are intended only for
use by the addressee(s) named herein. If you are not the intended
recipient, you must not copy this message or attachment or disclose
the contents to any other person. If you have received this
transmission in error, please notify the sender immediately and
delete the message and any attachment from your system. Merck
Serono does not accept liability for any omissions or errors in
this message which may arise as a result of E-Mail-transmission or
for damages resulting from any unauthorized changes of the content
of this message and any attachment thereto. If verification is
required, please request a hard-copy version. Merck Serono does not
guarantee that this message is free of viruses and does not accept
liability for any damages caused by any virus transmitted
therewith.___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/