Re: [RDBO] How to register a db using DBI::Proxy?

2007-08-29 Thread Michael Lackhoff
On 09.08.2007 13:42 John Siracusa wrote:

 On 8/9/07 6:13 AM, Michael Lackhoff wrote:
 I get this error message:
 Attempt to change driver from 'oracle' to 'proxy' detected.  The driver
 cannot be changed after object creation. at test02.pl line 8

 Is it possible to persuade Rose::DB that the 'proxy' still is 'oracle'
 
 I'll make the necessary change in SVN when I get a chance.

Did you find some time for DBI::Proxy support, yet?

In the meantime I tried Philip Dye's subclass (thanks for sharing!) but
with no luck. In the original version I got the error message Can't
connect to data source 'dbi:Oracle-Proxy:dbname=... which seems to be a
DBI error. It looks as if Rose::DB uses the driver from the registry and
not from build_dsn here.
It doesn't help when I change
sub dbi_driver { 'Oracle-Proxy' } to
sub dbi_driver { 'Proxy' }

Then I tried to fix namespace issues by changing from
package Rose::DB::Oracle::Proxy; to package Rose::DB::Proxy;
now I could use 'proxy' as the driver everywhere but all I got was a
different error message:
DBI connect('dbname=mydb;host=myhost;port=12000','myuser',...) failed:
Missing hostname. Missing remote dsn. at e:/www/perl/site/lib/Rose/DB.pm
line 829
It doesn't even help when I hardcode the correct and tested dsn as the
return value of build_dsn (same error message).

Did anyone succeed in taming this proxy beast?

-Michael


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] How to register a db using DBI::Proxy?

2007-08-29 Thread John Siracusa
On 8/29/07, Michael Lackhoff [EMAIL PROTECTED] wrote:
 Did you find some time for DBI::Proxy support, yet?

No, sorry, haven't gotten to it yet.

-John

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] How to register a db using DBI::Proxy?

2007-08-10 Thread Philip Dye

I missed a few lines in my previous message.  They have been inserted below.

- philip

news wrote:
I took the approach of creating Rose::DB::Oracle::Proxy as a subclass 
of Rose::DB::Oracle.


Then in CMUCS::RAMS::DB:

package CMUCS::RAMS::DB ;


   use 5.006 ;
   use strict ;
   use warnings ;

   our $VERSION = '0.01' ;

   use base 'Rose::DB' ;


__PACKAGE__-use_private_registry ;

__PACKAGE__-default_domain('development');
__PACKAGE__-default_type('proxy');

__PACKAGE__-driver_class ( 'Oracle-Proxy' =
'Rose::DB::Oracle::Proxy' ) ;

__PACKAGE__-register_db
  ( domain  = 'development'
  , type= 'proxy'
  , driver  = 'Oracle-Proxy'
  , database= undef
  , host= '???.svc.cs.cmu.edu'
  , port= 7026
  , username= '/@devdb'
  , password= ''
  , connect_options =
{ sasl  = 1
, sasl_mechanism= 'GSSAPI'
, sasl_service  = 'sasl-service-name'
, sasl_cb_user  = \getusername
, sasl_cb_auth  = \getusername
, sasl_cb_pass  = \getpassword
, sasl_cb_canonuser = \canonuser
, sasl_cb_language  = 1
}
  ) ;

I haven't uploaded it to CPAN yet since I haven't had time to complete 
the documentation since I am in the middle of a production rollout of 
a new application.


As a side note, the reference to SASL in the module documentation 
relates to my modified versions of DBD::Proxy and DBI::ProxyServer 
(and RPC::PlServer, RPC::PlClient, Net::Daemon) that cleanly handle 
SASL authentication.  They require a good bit more work before a 
public release.  First, Authen::SASL::Cyrus itself requires some bug 
fixes and updates, then my implementation of IO::Socket::SASL (not to 
be confused with IO::Socket::SSL) which they use.  Given my current 
workload, I just might be able to get started on this by 
Thanksgiving.  If one or more parties have both an imminent need for 
SASL authenticated services and the interest/experience in protocol 
issues, collaboration could speed up the process.


- philip

Michael Lackhoff wrote:

Hello,

I am trying to use Rose::DB for a new project that uses an Oracle
database but the connection is done with DBI::Proxy (then I don't have
to install DBD::Oracle on every machine that accesses the database)

After reading the docs the best I could manage was this:
My::DB-register_db(
domain   = DOD2::DB-default_domain,
type = DOD2::DB-default_type,
driver   = 'Oracle',
dsn = dbi:Proxy:hostname=myserver;port=12000;dsn=dbi:Oracle:mydb,
username = 'someone',
password = 'secret',
);

But I get this error message:
Attempt to change driver from 'oracle' to 'proxy' detected.  The driver
cannot be changed after object creation. at test02.pl line 8

Is it possible to persuade Rose::DB that the 'proxy' still is 'oracle'
or what would a correct register_db look like?

Thanks,
Michael


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object
  




-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/


___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


package Rose::DB::Oracle::Proxy ;

use strict;

use base 'Rose::DB::Oracle' ;

use Rose::DB;

our $Debug = 0;

our $VERSION  = '0.01'; 

sub build_dsn
{
  my ( $self_or_class, %args ) = @_ ;

  my ( $dsn, $value ) = '' ;

  defined ( $value = $args{'host'} || $args{'hostname'} ) 
( $dsn .= ';hostname=' . $value ) ;

  defined ( $value = $args{'port'} ) 
( $dsn .= ';port=' . $value ) ;

  $dsn .= ';dsn=dbi:Oracle:' ;

  defined ( $value = $args{'db'} || $args{'database'} )   
( $dsn .= $value ) ;

  $dsn = 'dbi:Proxy:' . substr($dsn,1) ;

  $Debug 
printf STDERR [dsn] '%s'\n ;

  $dsn ;
}

sub dbi_driver { 'Oracle-Proxy' }

1;
=head1 NAME

Rose::DB::Oracle::Proxy - Proxied Oracle driver class for Rose::DB.

=head1 SYNOPSIS

  use 

[RDBO] How to register a db using DBI::Proxy?

2007-08-09 Thread Michael Lackhoff
Hello,

I am trying to use Rose::DB for a new project that uses an Oracle
database but the connection is done with DBI::Proxy (then I don't have
to install DBD::Oracle on every machine that accesses the database)

After reading the docs the best I could manage was this:
My::DB-register_db(
domain   = DOD2::DB-default_domain,
type = DOD2::DB-default_type,
driver   = 'Oracle',
dsn = dbi:Proxy:hostname=myserver;port=12000;dsn=dbi:Oracle:mydb,
username = 'someone',
password = 'secret',
);

But I get this error message:
Attempt to change driver from 'oracle' to 'proxy' detected.  The driver
cannot be changed after object creation. at test02.pl line 8

Is it possible to persuade Rose::DB that the 'proxy' still is 'oracle'
or what would a correct register_db look like?

Thanks,
Michael


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] How to register a db using DBI::Proxy?

2007-08-09 Thread Tim Bunce
On Thu, Aug 09, 2007 at 07:42:36AM -0400, John Siracusa wrote:
 On 8/9/07 6:13 AM, Michael Lackhoff wrote:
  I get this error message:
  Attempt to change driver from 'oracle' to 'proxy' detected.  The driver
  cannot be changed after object creation. at test02.pl line 8
  
  Is it possible to persuade Rose::DB that the 'proxy' still is 'oracle'
 
 I'll make the necessary change in SVN when I get a chance.

Would be good to make sure DBD::Gofer work as well.
(http://backpan.perl.org/authors/id/T/TI/TIMB/Gofer-200707.pdf)

Tim.

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object