aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/statement.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-10-31 12:33:32 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-11-01 13:23:30 +0200
commit4e02fdf9dd78de05668370257c4c48bcf4572065 (patch)
tree84990438698e36702ffeae5dcb2e7a9b22677411 /odb/oracle/statement.cxx
parent3a26175dac1392eb1a4a55cc5b01fcca869d91a0 (diff)
Store the OCIDefine handle for LOB result parameters and reuse it on rebinding
Diffstat (limited to 'odb/oracle/statement.cxx')
-rw-r--r--odb/oracle/statement.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/odb/oracle/statement.cxx b/odb/oracle/statement.cxx
index f29136a..129b237 100644
--- a/odb/oracle/statement.cxx
+++ b/odb/oracle/statement.cxx
@@ -288,6 +288,12 @@ namespace odb
if (r == OCI_ERROR || r == OCI_INVALID_HANDLE)
translate_error (err, r);
+ // The OCIDefine handle is stored in the size member of the bind in
+ // case the LOB parameter is rebound. If rebinding is necessary, the
+ // same OCIDefine handle is used.
+ //
+ b->size = reinterpret_cast<ub2*> (h);
+
// LOB prefetching is only supported in OCI version 11.1 and greater
// and in Oracle server 11.1 and greater. If this code is called
// against a pre 11.1 server, the call to OCIAttrSet will return an
@@ -396,7 +402,8 @@ namespace odb
lob->reset (h);
}
- OCIDefine* h(0);
+ OCIDefine* h (reinterpret_cast<OCIDefine*> (b->size));
+
sword r (OCIDefineByPos (stmt_,
&h,
err,