[svn:dbd-oracle] r14820 - dbd-oracle/trunk
[email protected] Mon, 4 Apr 2011 14:33:54 -0700 (PDT)
| Newsgroups | perl.dbd.oracle.changes |
|---|---|
| Message-ID | <[email protected]> |
Author: byterock
Date: Mon Apr 4 14:33:53 2011
New Revision: 14820
Modified:
dbd-oracle/trunk/Changes
dbd-oracle/trunk/Makefile.PL
dbd-oracle/trunk/Oracle.pm
dbd-oracle/trunk/dbdimp.c
dbd-oracle/trunk/dbdimp.h
Log:
Remove support for ProC connections
Modified: dbd-oracle/trunk/Changes
==============================================================================
--- dbd-oracle/trunk/Changes (original)
+++ dbd-oracle/trunk/Changes Mon Apr 4 14:33:53 2011
@@ -1,5 +1,6 @@
=head1 Changes in DBD-Oracle 1.29_1 (svn rev NNNNN)
+ Removed support for ProcC connections John Scoles
Added support for TAF callback by John Scoles
Fixed some compiler warnings in dbdimp.c and oci8.c by Martin J. Evans
Added Test::Simple 0.90 to build_requires as we use note etc by Martin J. Evans
Modified: dbd-oracle/trunk/Makefile.PL
==============================================================================
--- dbd-oracle/trunk/Makefile.PL (original)
+++ dbd-oracle/trunk/Makefile.PL Mon Apr 4 14:33:53 2011
@@ -88,9 +88,9 @@
#$::opt_ic10 = 1; # Build for Oracle 10g instantclient
$::opt_b = 1; # try to use Oracle's own 'build' rule
$::opt_r = ''; # With -b above, use this names build rule (eg -r=build64)
-$::opt_m = ''; # path to proc.mk or oracle.mk file to read
+$::opt_m = ''; # path to oracle.mk file to read
$::opt_h = ''; # path to oracle header files
-$::opt_p = ''; # alter preference for oracle.mk over proc
+$::opt_p = ''; # alter preference for oracle.mk
$::opt_n = ''; # Oracle .mk macro name to use for library list to link with
$::opt_c = 0; # don't encourage use of shared library
$::opt_l = 0; # try direct-link to libclntsh
@@ -103,13 +103,12 @@
$::opt_F = 0; # force - ignore errors
$::opt_W = 0; # just write a basic default Makefile (won't build)
$::opt_w = 0; # enable many gcc compiler warnings
-$::opt_ProC= 0; # enable integration with ProC
$::opt_V = 0; # force assumption of specified Oracle version
# If == 8 then we don't use the new OCI_INIT code
# and we force our emulation of OCILobWriteAppend
Getopt::Long::config( qw( no_ignore_case ) );
-GetOptions(qw(b! r=s v! d! g! p! l! c! f! F! W! w! m=s h=s n=s s=s S=s V=s ProC!))
+GetOptions(qw(b! r=s v! d! g! p! l! c! f! F! W! w! m=s h=s n=s s=s S=s V=s ))
or die "Invalid arguments";
$::opt_g &&= '-g'; # convert to actual string
@@ -668,10 +667,7 @@
$opts{DEFINE} .= ' -Xa' if $Config{cc} eq 'clcc'; # CenterLine CC
-if ($::opt_ProC) {
- $opts{DEFINE} .= ' -DCAN_USE_PRO_C' ;
- print "Seems you want to use ProC connections. Both the Instant Clients and Oracle XE client may not work!!\n\n";
-}
+
@@ -1076,11 +1072,7 @@
sub find_mkfile {
- my @mk_proc = ( 'precomp/demo/proc/proc.mk',
- 'precomp/demo/proc/demo_proc.mk',
- 'proc/lib/proc.mk',
- 'proc16/lib/proc16.mk',
- );
+
my @mk_oci32 = (
'rdbms/demo/demo_xe.mk',
'rdbms/demo/demo_rdbms32.mk'
@@ -1095,17 +1087,14 @@
);
my @mk_oci = perl_is_64bit() ? @mk_oci64 : @mk_oci32;
- $client_version and push @mk_proc, # Oracle Instant Client
- "/usr/share/oracle/$client_version/client/demo.mk",
- "/usr/share/oracle/$client_version/client64/demo.mk";
-
+
# Add build.mk from /usr/share/oracle based on the oracle home location if
# oracle home is under /usr/lib/oracle (Linux RPM install).
# The 11g instant client only contains build.mk located in
# /usr/share/oracle/
push @mk_oci, "/usr/share/oracle/$1/demo.mk" if ($OH =~ m|^/usr/lib/oracle/(.*)|);
- my @mkplaces = ($::opt_p) ? (@mk_proc,@mk_oci) : (@mk_oci,@mk_proc);
+ my @mkplaces = ($::opt_p) ? (@mk_oci) : (@mk_oci);
if ($::opt_m) {
$::opt_m = cwd()."/$::opt_m" unless $::opt_m =~ m:^/:;
die "-m $::opt_m: not found" unless -f $::opt_m;
@@ -1120,13 +1109,12 @@
print "Found $place\n";
}
die qq{
- Unable to locate an oracle.mk, proc.mk or other suitable *.mk
+ Unable to locate an oracle.mk or other suitable *.mk
file in your Oracle installation. (I looked in
@mkplaces under $OH)
The oracle.mk (or demo_rdbms.mk) file is part of the Oracle
- RDBMS product. The proc.mk (or demo_proc.mk) file is part of
- the Oracle Pro*C product. You need to build DBD::Oracle on a
+ RDBMS product. You need to build DBD::Oracle on a
system which has one of these Oracle components installed.
(Other *.mk files such as the env_*.mk files will not work.)
Alternatively you can use Oracle Instant Client.
Modified: dbd-oracle/trunk/Oracle.pm
==============================================================================
--- dbd-oracle/trunk/Oracle.pm (original)
+++ dbd-oracle/trunk/Oracle.pm Mon Apr 4 14:33:53 2011
@@ -359,9 +359,7 @@
ora_ph_csform => undef,
ora_parse_error_offset => undef,
ora_dbh_share => undef,
- ora_use_proc_connection=> undef,
ora_envhp => undef,
- ora_context => undef,
ora_svchp => undef,
ora_errhp => undef,
ora_init_mode => undef,
@@ -1116,9 +1114,8 @@
=head1 Which version DBD::Oracle is for me?
-From version 1.25 onwards DBD::Oracle will only support Oracle clients 9.2 or greater and it will
-be dropping support for ProC connections in 1.29. Sorry for this it was just getting to hard to
-maintain the code base for an ever shrinking user base. This is especially so with the many new functions
+From version 1.25 onwards DBD::Oracle will only support Oracle clients 9.2 or greater as well
+support for ProC connections was dropped in 1.29. This is especially so with the many new functions
being introduced in 10g and 11g.
If you are still stuck with an older version of Oracle or its client you might want to look at the table below.
@@ -1163,11 +1160,7 @@
supported anymore and will be removed in 1.29.
7) It seems that the 10g client can only connect to 9 and 11 DBs while the 9 can go back to 7
and even get to 10. I am not sure what the 11g client can connect to.
- 8) DBD::Oracle still has the code in place for ProC. But good luck trying to get it to work
- with any of the instant clients as Oracle no longer ships the correct .mk files. I was
- unable to get it to work with Oracle 11+ as it ships with only part of the full ProC install.
- You may have to get a full version of ProC from Oracle to get it to compile. It is also
- slated to be removed in 1.29
+
=head1 CONNECTING TO ORACLE
@@ -1865,33 +1858,6 @@
$dbh = DBI->connect ($dsn, $user, $passwd, {ora_dbh_share => \$orashr}) ;
-=item ora_context -->deprecated will be removed in 1.29
-
-Use this attribute to send a pointer to a ProC connection when the your dbname is set to extproc.
-
-=item ora_use_proc_connection -->deprecated will be removed in 1.29
-
-This attribute allows to create a DBI handle for an existing SQLLIB
-database connection. This can be used to share database connections
-between Oracle ProC code and DBI running in an embedded Perl interpreter.
-The SQLLIB connection id is appended after the "dbi:Oracle:" initial
-argument to DBI::connect.
-
-For example, if in ProC a connection is made like
-
- EXEC SQL CONNECT 'user/pass@db' AT 'CONID';
-
-the connection may be used from DBI after running something like
-
- my $dbh = DBI->connect("dbi:Oracle:CONID", "", "",
- { ora_use_proc_connection => 1 });
-
-To disconnect, first call $dbh->disconnect(), then disconnect in ProC.
-
-This attribute requires DBD::Oracle to be built with the -ProC
-option to Makefile.PL. It is not available with OCI_V7. Not tested
-with Perl ithreads or with the ora_dbh_share connect attribute.
-
=item ora_envhp
The first time a connection is made a new OCI 'environment' is
Modified: dbd-oracle/trunk/dbdimp.c
==============================================================================
--- dbd-oracle/trunk/dbdimp.c (original)
+++ dbd-oracle/trunk/dbdimp.c Mon Apr 4 14:33:53 2011
@@ -20,13 +20,7 @@
#include "Oracle.h"
-#if defined(CAN_USE_PRO_C)
-/* #include <sql2oci.h> for SQL_SINGLE_RCTX but causes clashes */
-#if !defined(SQL_SINGLE_RCTX)
-/* http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a97269/pc_01int.htm#1174 */
-#define SQL_SINGLE_RCTX (dvoid *)0 /* from precomp/public/sqlcpr.h */
-#endif
-#endif
+
/* XXX DBI should provide a better version of this */
#define IS_DBI_HANDLE(h) \
@@ -40,7 +34,7 @@
DBISTATE_DECLARE;
int ora_fetchtest; /* intrnal test only, not thread safe */
-int is_extproc = 0;
+int is_extproc = 0; /* not ProC but ExtProc.pm */
int dbd_verbose = 0; /* DBD only debugging*/
int oci_warn = 0; /* show oci warnings */
int ora_objects = 0; /* get oracle embedded objects as instance of DBD::Oracle::Object */
@@ -407,18 +401,6 @@
SV * shared_dbh_priv_sv ;
STRLEN shared_dbh_len = 0 ;
#endif
-#if defined(CAN_USE_PRO_C)
- struct OCIExtProcContext *this_ctx;
- ub4 use_proc_connection = 0;
- SV **use_proc_connection_sv;
-
- /* Check if we should re-use a ProC connection and not connect ourselves. */
- DBD_ATTRIB_GET_IV(attr, "ora_use_proc_connection", 23,
- use_proc_connection_sv, use_proc_connection);
-#else /*CAN_USE_PRO_C*/
- 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 */
@@ -599,94 +581,14 @@
imp_dbh->envhp = NULL; /* force new environment */
forced_new_environment = 1;
}
-#if defined(CAN_USE_PRO_C)
- else {
- IV tmp;
- if (!sv_isa(*svp, "ExtProc::OCIEnvHandle"))
- croak("ora_envhp value is not of type ExtProc::OCIEnvHandle");
- /* MJE cannot believe the following will work on 64bit platforms */
- tmp = SvIV((SV*)SvRV(*svp));
- imp_dbh->envhp = (struct OCIEnv *)tmp;
- }
-#endif /*CAN_USE_PRO_C*/
- }
-#if defined(CAN_USE_PRO_C)
- /* "extproc" dbname is special if "ora_context" attribute also given */
- if (strEQ(dbname,"extproc") && (svp=DBD_ATTRIB_GET_SVP(attr, "ora_context", 11))) {
- IV tmp;
- SV **svcsvp;
- SV **errsvp;
- if (!svp)
- croak("pointer to context SV is NULL");
- if (!sv_isa(*svp, "ExtProc::OCIExtProcContext"))
- croak("ora_context value is not of type ExtProc::OCIExtProcContext");
- tmp = SvIV((SV*)SvRV(*svp));
- this_ctx = (struct OCIExtProcContext *)tmp;
- if (this_ctx == NULL)
- croak("ora_context referenced ExtProc value is NULL");
- /* new */
- if ((svcsvp=DBD_ATTRIB_GET_SVP(attr, "ora_svchp", 9)) &&
- (errsvp=DBD_ATTRIB_GET_SVP(attr, "ora_errhp", 9))
- ) {
- if (!sv_isa(*svcsvp, "ExtProc::OCISvcHandle"))
- croak("ora_svchp value is not of type ExtProc::OCISvcHandle");
- tmp = SvIV((SV*)SvRV(*svcsvp));
- imp_dbh->svchp = (struct OCISvcCtx *)tmp;
- if (!sv_isa(*errsvp, "ExtProc::OCIErrHandle"))
- croak("ora_errhp value is not of type ExtProc::OCIErrHandle");
- tmp = SvIV((SV*)SvRV(*errsvp));
- imp_dbh->errhp = (struct OCIError *)tmp;
- }
- /* end new */
- else {
- status = OCIExtProcGetEnv(this_ctx, &imp_dbh->envhp,
- &imp_dbh->svchp, &imp_dbh->errhp);
- if (status != OCI_SUCCESS) {
- oci_error(dbh, (OCIError*)imp_dbh->envhp, status, "OCIExtProcGetEnv");
- return 0;
- }
- }
- is_extproc = 1;
- goto dbd_db_login6_out;
}
-
- if (!imp_dbh->envhp || is_extproc)
-#else /*CAN_USE_PRO_C*/
- if (!imp_dbh->envhp )
-#endif
- {
+ if (!imp_dbh->envhp ) {
SV **init_mode_sv;
ub4 init_mode = OCI_OBJECT; /* needed for LOBs (8.0.4) */
DBD_ATTRIB_GET_IV(attr, "ora_init_mode",13, init_mode_sv, init_mode);
-#if defined(USE_ITHREADS) || defined(MULTIPLICITY) || defined(USE_5005THREADS)
- init_mode |= OCI_THREADED;
-#endif
-
-#if defined(CAN_USE_PRO_C)
- if (use_proc_connection) {
- char *err_hint = Nullch;
-#ifdef SQL_SINGLE_RCTX
- /* Use existing SQLLIB connection. Do not call OCIInitialize(), */
- /* since presumably SQLLIB already did that. */
- status = SQLEnvGet(SQL_SINGLE_RCTX, &imp_dbh->envhp);
- imp_dbh->proc_handles = 1;
-#else
- status = OCI_ERROR;
- err_hint = "ProC connection reuse not available in this build of DBD::Oracle";
-#endif /* SQL_SINGLE_RCTX*/
- if (status != SQL_SUCCESS) {
- if (!err_hint)
- err_hint = "SQLEnvGet failed to load ProC environment";
- oci_error(dbh, NULL, status, err_hint);
- return 0;
- }
- }
- else /* Normal connect. */
-#endif /*CAN_USE_PRO_C*/
- {
+ {
size_t rsize = 0;
- imp_dbh->proc_handles = 0;
/* Get CLIENT char and nchar charset id values */
OCINlsEnvironmentVariableGet_log_stat( &charsetid,(size_t) 0, OCI_NLS_CHARSET_ID, 0, &rsize ,status );
if (status != OCI_SUCCESS) {
@@ -784,34 +686,11 @@
if (shared_dbh_ssv) { /*is this a cached or shared handle from DBI*/
if (!imp_dbh->envhp) { /*no hande so create a new one*/
-#if defined(CAN_USE_PRO_C)
- if (use_proc_connection) {
- char *err_hint = Nullch;
-#ifdef SQL_SINGLE_RCTX
- status = SQLEnvGet(SQL_SINGLE_RCTX, &imp_dbh->envhp);
- imp_dbh->proc_handles = 1;
-#else
- status = OCI_ERROR;
- err_hint = "ProC connection reuse not available in this build of DBD::Oracle";
-#endif /* SQL_SINGLE_RCTX*/
- if (status != SQL_SUCCESS) {
- if (!err_hint)
- err_hint = "SQLEnvGet failed to load ProC environment";
- oci_error(dbh, (OCIError*)imp_dbh->envhp, status, err_hint);
- return 0;
- }
- }
- else {
-#endif /* CAN_USE_PRO_C */
- OCIEnvInit_log_stat( &imp_dbh->envhp, OCI_DEFAULT, 0, 0, status);
- imp_dbh->proc_handles = 0;
- if (status != OCI_SUCCESS) {
- oci_error(dbh, (OCIError*)imp_dbh->envhp, status, "OCIEnvInit");
- return 0;
- }
-#if defined(CAN_USE_PRO_C)
+ OCIEnvInit_log_stat( &imp_dbh->envhp, OCI_DEFAULT, 0, 0, status);
+ if (status != OCI_SUCCESS) {
+ oci_error(dbh, (OCIError*)imp_dbh->envhp, status, "OCIEnvInit");
+ return 0;
}
-#endif
}
}
@@ -846,10 +725,6 @@
PerlIO_printf(DBILOGFP," charset id=%d, name=%s, ncharset id=%d, name=%s"
" (csid: utf8=%d al32utf8=%d)\n",
charsetid,charsetname, ncharsetid,ncharsetname, utf8_csid, al32utf8_csid);
-#if defined(CAN_USE_PRO_C)
- if (imp_dbh->proc_handles)
- PerlIO_printf(DBILOGFP," Useing a ProC Connection\n");
-#endif
#ifdef ORA_OCI_112
if (imp_dbh->using_drcp)
PerlIO_printf(DBILOGFP," Useing DRCP Connection\n ");
@@ -857,141 +732,100 @@
}
if (!shared_dbh) {
-#if defined(CAN_USE_PRO_C)
- if(use_proc_connection) {
-#ifdef SQL_SINGLE_RCTX
-
- imp_dbh->proc_handles = 1;
- status = SQLSvcCtxGet(SQL_SINGLE_RCTX, dbname, strlen(dbname),
- &imp_dbh->svchp);
- if (status != SQL_SUCCESS) {
- oci_error(dbh, imp_dbh->errhp, status, "SQLSvcCtxGet");
- OCIHandleFree_log_stat(imp_dbh->errhp, OCI_HTYPE_ERROR, status);
- return 0;
- }
- OCIAttrGet_log_stat(imp_dbh->svchp, OCI_HTYPE_SVCCTX, &imp_dbh->srvhp, NULL,
- OCI_ATTR_SERVER, imp_dbh->errhp, status);
- if (status != OCI_SUCCESS) {
- oci_error(dbh, imp_dbh->errhp, status,
- "OCIAttrGet. Failed to get server context.");
- OCIHandleFree_log_stat(imp_dbh->errhp, OCI_HTYPE_ERROR, status);
- return 0;
- }
+ OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->srvhp, OCI_HTYPE_SERVER, status);
- OCIAttrGet_log_stat(imp_dbh->svchp, OCI_HTYPE_SVCCTX, &imp_dbh->seshp, NULL,
- OCI_ATTR_SESSION, imp_dbh->errhp, status);
- if (status != OCI_SUCCESS) {
- oci_error(dbh, imp_dbh->errhp, status,
- "OCIAttrGet. Failed to get authentication context.");
- OCIHandleFree_log_stat(imp_dbh->errhp, OCI_HTYPE_ERROR, status);
- return 0;
- }
-#else /* SQL_SINGLE_RCTX */
- oci_error(dbh, (OCIError*)imp_dbh->envhp, OCI_ERROR,
- "ProC connection reuse not available in this build of DBD::Oracle");
-#endif /* SQL_SINGLE_RCTX*/
+ if (status != OCI_SUCCESS) {
+ oci_error(dbh, imp_dbh->errhp, status, "OCIServerAttach");
+ OCIHandleFree_log_stat(imp_dbh->srvhp, OCI_HTYPE_SERVER, status);
+ OCIHandleFree_log_stat(imp_dbh->errhp, OCI_HTYPE_ERROR, status);
+ return 0;
}
- else { /* !use_proc_connection */
-#endif /*CAN_USE_PRO_C*/
-
- imp_dbh->proc_handles = 0;
-
- OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->srvhp, OCI_HTYPE_SERVER, status);
- if (status != OCI_SUCCESS) {
- oci_error(dbh, imp_dbh->errhp, status, "OCIServerAttach");
- OCIHandleFree_log_stat(imp_dbh->srvhp, OCI_HTYPE_SERVER, status);
- OCIHandleFree_log_stat(imp_dbh->errhp, OCI_HTYPE_ERROR, status);
- return 0;
- }
-
- {
- SV **sess_mode_type_sv;
- ub4 sess_mode_type = OCI_DEFAULT;
- ub4 cred_type;
- DBD_ATTRIB_GET_IV(attr, "ora_session_mode",16, sess_mode_type_sv, sess_mode_type);
+ {
+ SV **sess_mode_type_sv;
+ ub4 sess_mode_type = OCI_DEFAULT;
+ ub4 cred_type;
+ DBD_ATTRIB_GET_IV(attr, "ora_session_mode",16, sess_mode_type_sv, sess_mode_type);
#ifdef ORA_OCI_112
- if (imp_dbh->using_drcp) { /* connect uisng a DRCP */
- ub4 purity = OCI_ATTR_PURITY_SELF;
- /* pool Default values */
- if (!imp_dbh->pool_min )
- imp_dbh->pool_min = 4;
- if (!imp_dbh->pool_max )
- imp_dbh->pool_max = 40;
- if (!imp_dbh->pool_incr)
- imp_dbh->pool_incr = 2;
-
- OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->poolhp, OCI_HTYPE_SPOOL, status);
-
- OCISessionPoolCreate_log_stat(imp_dbh->envhp,
- imp_dbh->errhp,
- imp_dbh->poolhp,
- (OraText **) &imp_dbh->pool_name,
- (ub4 *) &imp_dbh->pool_namel,
- (OraText *) dbname,
- strlen(dbname),
- imp_dbh->pool_min,
- imp_dbh->pool_max,
- imp_dbh->pool_incr,
- (OraText *) uid,
- strlen(uid),
- (OraText *) pwd,
- strlen(pwd),
- status);
+ if (imp_dbh->using_drcp) { /* connect uisng a DRCP */
+ ub4 purity = OCI_ATTR_PURITY_SELF;
+ /* pool Default values */
+ if (!imp_dbh->pool_min )
+ imp_dbh->pool_min = 4;
+ if (!imp_dbh->pool_max )
+ imp_dbh->pool_max = 40;
+ if (!imp_dbh->pool_incr)
+ imp_dbh->pool_incr = 2;
+
+ OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->poolhp, OCI_HTYPE_SPOOL, status);
+
+ OCISessionPoolCreate_log_stat(imp_dbh->envhp,
+ imp_dbh->errhp,
+ imp_dbh->poolhp,
+ (OraText **) &imp_dbh->pool_name,
+ (ub4 *) &imp_dbh->pool_namel,
+ (OraText *) dbname,
+ strlen(dbname),
+ imp_dbh->pool_min,
+ imp_dbh->pool_max,
+ imp_dbh->pool_incr,
+ (OraText *) uid,
+ strlen(uid),
+ (OraText *) pwd,
+ strlen(pwd),
+ status);
- if (status != OCI_SUCCESS) {
+ 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->poolhp, OCI_HTYPE_SPOOL,status);
- OCIHandleFree_log_stat(imp_dbh->srvhp, OCI_HTYPE_SERVER, status);
- OCIHandleFree_log_stat(imp_dbh->errhp, OCI_HTYPE_ERROR, status);
- return 0;
- }
+ 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->poolhp, OCI_HTYPE_SPOOL,status);
+ OCIHandleFree_log_stat(imp_dbh->srvhp, OCI_HTYPE_SERVER, status);
+ OCIHandleFree_log_stat(imp_dbh->errhp, OCI_HTYPE_ERROR, status);
+ return 0;
+ }
- OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->authp, OCI_HTYPE_AUTHINFO, status);
+ OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->authp, OCI_HTYPE_AUTHINFO, status);
- OCIAttrSet_log_stat(imp_dbh->authp, (ub4) OCI_HTYPE_AUTHINFO,
- &purity, (ub4) 0,(ub4) OCI_ATTR_PURITY, imp_dbh->errhp, status);
+ OCIAttrSet_log_stat(imp_dbh->authp, (ub4) OCI_HTYPE_AUTHINFO,
+ &purity, (ub4) 0,(ub4) OCI_ATTR_PURITY, imp_dbh->errhp, status);
- if (imp_dbh->pool_class) /*pool_class may or may not be used */
+ if (imp_dbh->pool_class) /*pool_class may or may not be used */
OCIAttrSet_log_stat(imp_dbh->authp, (ub4) OCI_HTYPE_AUTHINFO,
(OraText *) imp_dbh->pool_class, (ub4) imp_dbh->pool_classl,
(ub4) OCI_ATTR_CONNECTION_CLASS, imp_dbh->errhp, status);
- cred_type = ora_parse_uid(imp_dbh, &uid, &pwd);
+ cred_type = ora_parse_uid(imp_dbh, &uid, &pwd);
- OCISessionGet_log_stat(imp_dbh->envhp, imp_dbh->errhp, &imp_dbh->svchp, imp_dbh->authp,
+ OCISessionGet_log_stat(imp_dbh->envhp, imp_dbh->errhp, &imp_dbh->svchp, imp_dbh->authp,
imp_dbh->pool_name, (ub4)strlen((char *)imp_dbh->pool_name), status);
- if (status != OCI_SUCCESS) {
-
- oci_error(dbh, imp_dbh->errhp, status, "OCISessionGet");
- OCIServerDetach_log_stat(imp_dbh->srvhp, imp_dbh->errhp, OCI_DEFAULT, status);
- OCISessionPoolDestroy(imp_dbh->poolhp, imp_dbh->errhp,status);
- OCIHandleFree_log_stat(imp_dbh->poolhp, OCI_HTYPE_SPOOL,status);
- OCIHandleFree_log_stat(imp_dbh->srvhp, OCI_HTYPE_SERVER, status);
- OCIHandleFree_log_stat(imp_dbh->errhp, OCI_HTYPE_ERROR, status);
+ if (status != OCI_SUCCESS) {
- return 0;
- }
+ oci_error(dbh, imp_dbh->errhp, status, "OCISessionGet");
+ OCIServerDetach_log_stat(imp_dbh->srvhp, imp_dbh->errhp, OCI_DEFAULT, status);
+ OCISessionPoolDestroy(imp_dbh->poolhp, imp_dbh->errhp,status);
+ OCIHandleFree_log_stat(imp_dbh->poolhp, OCI_HTYPE_SPOOL,status);
+ OCIHandleFree_log_stat(imp_dbh->srvhp, OCI_HTYPE_SERVER, status);
+ OCIHandleFree_log_stat(imp_dbh->errhp, OCI_HTYPE_ERROR, status);
+ return 0;
+ }
- if (DBIS->debug >= 4 || dbd_verbose >= 4 ) {
- PerlIO_printf(DBILOGFP,"Using DRCP with session settings min=%d, max=%d, and increment=%d\n",imp_dbh->pool_min,
- imp_dbh->pool_max,
- imp_dbh->pool_incr);
- if (imp_dbh->pool_class)
- PerlIO_printf(DBILOGFP,"with connection class=%s\n",imp_dbh->pool_class);
+ if (DBIS->debug >= 4 || dbd_verbose >= 4 ) {
+ PerlIO_printf(DBILOGFP,"Using DRCP with session settings min=%d, max=%d, and increment=%d\n",imp_dbh->pool_min,
+ imp_dbh->pool_max,
+ imp_dbh->pool_incr);
+ if (imp_dbh->pool_class)
+ PerlIO_printf(DBILOGFP,"with connection class=%s\n",imp_dbh->pool_class);
}
}
else {
#endif /* ORA_OCI_112 */
-
OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->svchp, OCI_HTYPE_SVCCTX, status);
OCIServerAttach_log_stat(imp_dbh, dbname,OCI_DEFAULT, status);
@@ -1028,14 +862,8 @@
#endif
}
-#if defined(CAN_USE_PRO_C)
- } /* use_proc_connection */
-#endif
}
-#if defined(CAN_USE_PRO_C)
-dbd_db_login6_out:
-#endif
DBIc_IMPSET_on(imp_dbh); /* imp_dbh set up now */
DBIc_ACTIVE_on(imp_dbh); /* call disconnect before freeing */
imp_dbh->ph_type = 1; /* SQLT_CHR "(ORANET TYPE) character string" */
@@ -1199,7 +1027,7 @@
/* Oracle will commit on an orderly disconnect. */
/* See DBI Driver.xst file for the DBI approach. */
- if (refcnt == 1 && !imp_dbh->proc_handles) {
+ if (refcnt == 1 ) {
sword s_se, s_sd;
#ifdef ORA_OCI_112
if (imp_dbh->using_drcp) {
@@ -1234,43 +1062,44 @@
#if defined(USE_ITHREADS) && defined(PERL_MAGIC_shared_scalar)
if (DBIc_IMPSET(imp_dbh) && imp_dbh->shared_dbh) {
- SvLOCK (imp_dbh->shared_dbh_priv_sv) ;
- refcnt = imp_dbh -> shared_dbh -> refcnt-- ;
+ SvLOCK (imp_dbh->shared_dbh_priv_sv) ;
+ refcnt = imp_dbh -> shared_dbh -> refcnt-- ;
}
#endif
if (refcnt == 1) {
+ sword status;
+
if (DBIc_ACTIVE(imp_dbh))
dbd_db_disconnect(dbh, imp_dbh);
if (is_extproc)
goto dbd_db_destroy_out;
- if (!imp_dbh->proc_handles) {
- sword status;
- if (imp_dbh->using_taf){
- OCIFocbkStruct tafailover;
- tafailover.fo_ctx = NULL;
- tafailover.callback_function = NULL;
- OCIAttrSet_log_stat(imp_dbh->srvhp, (ub4) OCI_HTYPE_SERVER,
- (dvoid *) &tafailover, (ub4) 0,
- (ub4) OCI_ATTR_FOCBK, imp_dbh->errhp, status);
- }
+ if (imp_dbh->using_taf){
+ OCIFocbkStruct tafailover;
+ tafailover.fo_ctx = NULL;
+ tafailover.callback_function = NULL;
+ OCIAttrSet_log_stat(imp_dbh->srvhp, (ub4) OCI_HTYPE_SERVER,
+ (dvoid *) &tafailover, (ub4) 0,
+ (ub4) OCI_ATTR_FOCBK, imp_dbh->errhp, status);
+
+ }
#ifdef ORA_OCI_112
- if (imp_dbh->using_drcp) {
- OCIHandleFree_log_stat(imp_dbh->authp, OCI_HTYPE_SESSION,status);
- OCISessionPoolDestroy_log_stat(imp_dbh->poolhp, imp_dbh->errhp,status);
- OCIHandleFree_log_stat(imp_dbh->poolhp, OCI_HTYPE_SPOOL,status);
- }
- else {
+ if (imp_dbh->using_drcp) {
+ OCIHandleFree_log_stat(imp_dbh->authp, OCI_HTYPE_SESSION,status);
+ OCISessionPoolDestroy_log_stat(imp_dbh->poolhp, imp_dbh->errhp,status);
+ OCIHandleFree_log_stat(imp_dbh->poolhp, OCI_HTYPE_SPOOL,status);
+ }
+ else {
#endif
- OCIHandleFree_log_stat(imp_dbh->seshp, OCI_HTYPE_SESSION,status);
- OCIHandleFree_log_stat(imp_dbh->svchp, OCI_HTYPE_SVCCTX, status);
+ OCIHandleFree_log_stat(imp_dbh->seshp, OCI_HTYPE_SESSION,status);
+ OCIHandleFree_log_stat(imp_dbh->svchp, OCI_HTYPE_SVCCTX, status);
#ifdef ORA_OCI_112
- }
-#endif
- OCIHandleFree_log_stat(imp_dbh->srvhp, OCI_HTYPE_SERVER, status);
}
+#endif
+ OCIHandleFree_log_stat(imp_dbh->srvhp, OCI_HTYPE_SERVER, status);
+
}
OCIHandleFree_log_stat(imp_dbh->errhp, OCI_HTYPE_ERROR, status);
dbd_db_destroy_out:
Modified: dbd-oracle/trunk/dbdimp.h
==============================================================================
--- dbd-oracle/trunk/dbdimp.h (original)
+++ dbd-oracle/trunk/dbdimp.h Mon Apr 4 14:33:53 2011
@@ -21,8 +21,6 @@
struct imp_drh_st {
dbih_drc_t com; /* MUST be first element in structure */
OCIEnv *envhp;
- int proc_handles; /* If true, the envhp handle is owned by ProC
- and must not be freed. */
SV *ora_long;
SV *ora_trunc;
SV *ora_cache;
@@ -72,8 +70,6 @@
ub4 client_identifierl;
char *action; /*user defined*/
ub4 actionl;
- 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*/
int RowsInCache; /* this vaue is RO and cannot be set*/
int ph_type; /* default oratype for placeholders */