Author: byterock
Date: Fri Jun 18 17:20:50 2010
New Revision: 14170
Modified:
dbd-oracle/branches/DRCP_1.25/Oracle.pm
dbd-oracle/branches/DRCP_1.25/dbdimp.c
dbd-oracle/branches/DRCP_1.25/dbdimp.h
dbd-oracle/branches/DRCP_1.25/oci8.c
dbd-oracle/branches/DRCP_1.25/ocitrace.h
Log:
just a check in for today
Modified: dbd-oracle/branches/DRCP_1.25/Oracle.pm
==============================================================================
--- dbd-oracle/branches/DRCP_1.25/Oracle.pm (original)
+++ dbd-oracle/branches/DRCP_1.25/Oracle.pm Fri Jun 18 17:20:50 2010
@@ -177,7 +177,7 @@
sub connect {
my ($drh, $dbname, $user, $auth, $attr)= @_;
-
+use Data::Dumper;
if ($dbname =~ /;/) {
my ($n,$v);
@@ -191,12 +191,17 @@
} split /\s*;\s*/, $dbname;
my %dbname = ( PROTOCOL => 'tcp', @dbname );
+ if ($dbname{SERVER} eq "POOLED") {
+ $attr->{ora_drcp}=1;
+ warn(" I am pooled".$dbname{SERVER}."\n");
+
+ }
# extract main attributes for connect_data portion
- my @connect_data_attr = qw(SID INSTANCE_NAME SERVER SERVICE_NAME);
+ my @connect_data_attr = qw(SID INSTANCE_NAME SERVER SERVICE_NAME );
my %connect_data = map { ($_ => delete $dbname{$_}) }
grep { exists $dbname{$_} } @connect_data_attr;
+
my $connect_data = join "", map { "($_=$connect_data{$_})" } keys %connect_data;
-
return $drh->DBI::set_err(-1,
"Can't connect using this syntax without specifying a HOST and one of @connect_data_attr")
unless $dbname{HOST} and %connect_data;
@@ -226,6 +231,12 @@
$user = '' if not defined $user;
(my $user_only = $user) =~ s:/.*::;
+
+ if (substr($dbname,-7,7) eq ':POOLED'){
+ $dbname=substr($dbname,0,-7);
+ $attr->{ora_drcp} = 1;
+ }
+
my ($dbh, $dbh_inner) = DBI::_new_dbh($drh, {
'Name' => $dbname,
'dbi_imp_data' => $attr->{dbi_imp_data},
@@ -235,6 +246,7 @@
# Call Oracle OCI logon func in Oracle.xs file
# and populate internal handle data.
+
DBD::Oracle::db::_login($dbh, $dbname, $user, $auth, $attr)
or return undef;
Modified: dbd-oracle/branches/DRCP_1.25/dbdimp.c
==============================================================================
--- dbd-oracle/branches/DRCP_1.25/dbdimp.c (original)
+++ dbd-oracle/branches/DRCP_1.25/dbdimp.c Fri Jun 18 17:20:50 2010
@@ -44,7 +44,9 @@
int oci_warn = 0; /* show oci warnings */
int ora_objects = 0; /* get oracle embedded objects as instance of DBD::Oracle::Object */
int ora_ncs_buff_mtpl = 4; /* a mulitplyer for ncs clob buffers */
-
+#ifdef ORA_OCI_112
+int ora_drcp = 0; /* Use DRCP connection 11.2 and above only*/
+#endif
/* bitflag constants for figuring out how to handle utf8 for array binds */
#define ARRAY_BIND_NATIVE 0x01
#define ARRAY_BIND_UTF8 0x02
@@ -385,6 +387,12 @@
if (DBD_ATTRIB_TRUE(attr,"ora_use_proc_connection",23,svp))
croak ("You can only use a ProC connection, if your DBD::Oracle was built with the -ProC on the Makefile.PL") ;
#endif /*CAN_USE_PRO_C*/
+
+#ifdef ORA_OCI_112
+ /*check to see if the user is connecting with DRCP */
+ if (DBD_ATTRIB_TRUE(attr,"ora_drcp",8,svp))
+ DBD_ATTRIB_GET_IV( attr, "ora_drcp", 8, svp, ora_drcp);
+#endif
/* check to see if DBD_verbose or ora_verbose is set*/
if (DBD_ATTRIB_TRUE(attr,"dbd_verbose",11,svp))
DBD_ATTRIB_GET_IV( attr, "dbd_verbose", 11, svp, dbd_verbose);
@@ -776,22 +784,39 @@
OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->authp, OCI_HTYPE_SESSION, status);
{
- ub4 cred_type = ora_parse_uid(imp_dbh, &uid, &pwd);
SV **sess_mode_type_sv;
ub4 sess_mode_type = OCI_DEFAULT;
- char poolname; /* session pool name */
- ub4 poolnamelen; /* length of session pool name*/
- char dbname ='xe';
- ub4 dbname_len=2;
+
DBD_ATTRIB_GET_IV(attr, "ora_session_mode",16, sess_mode_type_sv, sess_mode_type);
+
+ PerlIO_printf(DBILOGFP, "pwd=%s uid=%s dbname=%s\n",pwd,uid,dbname);
+
+
#ifdef ORA_OCI_112
- if (sess_mode_type == OCI_DEFAULT) {
- OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->poolhp, OCI_HTYPE_CPOOL, status);
+PerlIO_printf(DBILOGFP,"ora_drcp=%d\n",ora_drcp);
- OCISessionPoolCreate_log_stat(imp_dbh->envhp,imp_dbh->errhp,imp_dbh->poolhp,&poolname,&poolnamelen,&dbname,&dbname_len,5,500,4,status);
+ if (ora_drcp) { /* connect uisng a DRCP */
- if (status != OCI_SUCCESS) {
+ OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->poolhp, OCI_HTYPE_SPOOL, status);
+PerlIO_printf(DBILOGFP,"OCIHandleAlloc_ok status=%s\n",oci_status_name(status));
+ OCISessionPoolCreate_log_stat(imp_dbh->envhp,
+ imp_dbh->errhp,
+ imp_dbh->poolhp,
+ (OraText **) &imp_dbh->pool_name,
+ (ub4 *) &imp_dbh->pool_namel,
+ dbname,
+ strlen(dbname),
+ 10,
+ 100,
+ 4,
+ uid,
+ strlen(uid),
+ pwd,
+ strlen(pwd),
+ status);
+
+ if (status != OCI_SUCCESS) {
oci_error(dbh, imp_dbh->errhp, status, "OCISessionPoolCreate");
OCIServerDetach_log_stat(imp_dbh->srvhp, imp_dbh->errhp, OCI_DEFAULT, status);
OCIHandleFree_log_stat(imp_dbh->authp, OCI_HTYPE_SESSION,status);
@@ -802,6 +827,8 @@
}
}
else {
+ ub4 cred_type = ora_parse_uid(imp_dbh, &uid, &pwd);
+
#endif
OCISessionBegin_log_stat( imp_dbh->svchp, imp_dbh->errhp, imp_dbh->authp,cred_type, sess_mode_type, status);
if (status == OCI_SUCCESS_WITH_INFO) {
@@ -1035,6 +1062,11 @@
if (kl==17 && strEQ(key, "ora_ncs_buff_mtpl") ) {
ora_ncs_buff_mtpl = SvIV (valuesv);
}
+#ifdef ORA_OCI_112
+ else if (kl==8 && strEQ(key, "ora_drcp") ) {
+ ora_drcp = SvIV (valuesv);
+ }
+#endif
else if (kl==20 && strEQ(key, "ora_oci_success_warn") ) {
oci_warn = SvIV (valuesv);
}
Modified: dbd-oracle/branches/DRCP_1.25/dbdimp.h
==============================================================================
--- dbd-oracle/branches/DRCP_1.25/dbdimp.h (original)
+++ dbd-oracle/branches/DRCP_1.25/dbdimp.h Fri Jun 18 17:20:50 2010
@@ -39,7 +39,11 @@
OCIServer *srvhp;
OCISvcCtx *svchp;
OCISession *authp;
- OCICPool *poolhp;
+#ifdef ORA_OCI_112
+ OCISPool *poolhp;
+ text *pool_name;
+ ub4 pool_namel;
+#endif
int proc_handles; /* If true, srvhp, svchp, and authp handles
are owned by ProC and must not be freed. */
int RowCacheSize; /* both of these are defined by DBI spec*/
@@ -266,7 +270,9 @@
extern int oci_warn;
extern int ora_objects;
extern int ora_ncs_buff_mtpl;
-
+#ifdef ORA_OCI_112
+extern int ora_drcp;
+#endif
extern ub2 charsetid;
extern ub2 ncharsetid;
extern ub2 us7ascii_csid;
Modified: dbd-oracle/branches/DRCP_1.25/oci8.c
==============================================================================
--- dbd-oracle/branches/DRCP_1.25/oci8.c (original)
+++ dbd-oracle/branches/DRCP_1.25/oci8.c Fri Jun 18 17:20:50 2010
@@ -333,6 +333,8 @@
case OCI_HTYPE_DESCRIBE: return "OCI_HTYPE_DESCRIBE";
case OCI_HTYPE_SERVER: return "OCI_HTYPE_SERVER";
case OCI_HTYPE_SESSION: return "OCI_HTYPE_SESSION";
+ case OCI_HTYPE_CPOOL: return "OCI_HTYPE_CPOOL";
+ case OCI_HTYPE_SPOOL: return "OCI_HTYPE_SPOOL";
/* Descriptors */
case OCI_DTYPE_LOB: return "OCI_DTYPE_LOB";
case OCI_DTYPE_SNAP: return "OCI_DTYPE_SNAP";
Modified: dbd-oracle/branches/DRCP_1.25/ocitrace.h
==============================================================================
--- dbd-oracle/branches/DRCP_1.25/ocitrace.h (original)
+++ dbd-oracle/branches/DRCP_1.25/ocitrace.h Fri Jun 18 17:20:50 2010
@@ -36,13 +36,12 @@
If done well the log will read like a compilable program.
*/
-
-#define OCISessionPoolCreate_log_stat(envhp,errhp,ph,pn,pnl,cs,csl,min,max,incr,stat)\
- stat =OCISessionPoolCreate(envhp,errhp,ph,pn,pnl,cs,csl,min,max,incr,(OraText *)0, (ub4)0, (OraText *)0,(ub4)0, OCI_DEFAULT)\
- (DBD_OCI_TRACEON) \
+#define OCISessionPoolCreate_log_stat(envhp,errhp,ph,pn,pnl,dbn,dbl,sn,sm,si,un,unl,pw,pwl,stat)\
+ stat =OCISessionPoolCreate(envhp,errhp,ph,pn,pnl,dbn,dbl,sn,sm,si,un,unl,pw,pwl,OCI_DEFAULT);\
+ (!DBD_OCI_TRACEON) \
? PerlIO_printf(DBD_OCI_TRACEFP,\
- "%OCISessionPoolCreate(%p,%p,%s,min=%d,max=%d,incr=%d)=%s\n",\
- OciTp, envhp,errhp,ph,pn,min,max,incr,oci_status_name(stat)),stat \
+ "%sOCISessionPoolCreate(envhp=%p,ph=%p,pn=%s,pnl=%d,min=%d,max=%d,incr=%d, un=%s,unl=%d,pw=%s,pwl=%d)=%s\n",\
+ OciTp, envhp,ph,pn,pnl,sn,sm,si,un,unl,pw,pwl,oci_status_name(stat)),stat \
: stat
#if defined(ORA_OCI_102)
@@ -356,7 +355,7 @@
#define OCIHandleAlloc_log_stat(ph,hp,t,xs,ump,stat) \
stat=OCIHandleAlloc(ph,hp,t,xs,ump); \
- (DBD_OCI_TRACEON) ? PerlIO_printf(DBD_OCI_TRACEFP, \
+ (!DBD_OCI_TRACEON) ? PerlIO_printf(DBD_OCI_TRACEFP, \
"%sHandleAlloc(%p,%p,%s,%lu,%p)=%s\n", \
OciTp, (void*)ph,(void*)hp,oci_hdtype_name(t),ul_t(xs),(void*)ump, \
oci_status_name(stat)),stat : stat
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.