An annoying ORA-01461 error from pdo_oci...

When I am working with pdo_oci development of Siren 1.x (Drupal 6.x), I face a critical problem: pdo_oci is not able to complete the Drupal installation procedure. BTW, as oci8 now share around 90% similar programming logic as that of pdo_oci, it works fine...

Since oci8 and pdo_oci drivers are assumed as interchangeable (they share both common.oracle.inc and schema.oracle.inc, so ~60% codes are share), I try to install with oci8 in order to get the DB up, then further more use pdo_oci during running. It looks all fine (and even pass ab test), but face a critical problem when accessing admin/build/modules (here is one of the error message, the others are similar):

user warning: OCIStmtExecute: ORA-01461: can bind a LONG value only for insert into a LONG column (/usr/local/src/php-5.2.5/ext/pdo_oci/oci_statement.c:146) query: INSERT INTO "menu_router" ("path", "load_functions", "to_arg_functions", "access_callback", "access_arguments", "page_callback", "page_arguments", "fit", "number_parts", "tab_parent", "tab_root", "title", "title_callback", "title_arguments", "type", "block_callback", "description", "position", "weight", "file") VALUES (:l5d0bafc60, :l5d0bafc61, :l5d0bafc62, :l5d0bafc63, :l5d0bafc64, :l5d0bafc65, :l5d0bafc66, :l5d0bafc67, :l5d0bafc68, :l5d0bafc69, :l5d0bafc610, :l5d0bafc611, :l5d0bafc612, :l5d0bafc613, :l5d0bafc614, :l5d0bafc615, :l5d0bafc616, :l5d0bafc617, :l5d0bafc618, :l5d0bafc619) in /mnt/hswong3i/project/drupal/drupal-6.x-siren-1.x/includes/common.oracle.inc on line 194.

When pressing F5, the case become even worse:

Fatal error: Uncaught exception 'PDOException' with message 'There is already an active transaction' in /mnt/hswong3i/project/drupal/drupal-6.x-siren-1.x/includes/database.pdo_oci.inc:182 Stack trace: #0 /mnt/hswong3i/project/drupal/drupal-6.x-siren-1.x/includes/database.pdo_oci.inc(182): PDO->beginTransaction() #1 /mnt/hswong3i/project/drupal/drupal-6.x-siren-1.x/includes/database.pdo_oci.inc(113): _db_query(Array) #2 /mnt/hswong3i/project/drupal/drupal-6.x-siren-1.x/includes/common.oracle.inc(194): db_query('INSERT INTO [{w...', Array) #3 /mnt/hswong3i/project/drupal/drupal-6.x-siren-1.x/includes/common.inc(3292): db_query_insert('watchdog', Array) #4 /mnt/hswong3i/project/drupal/drupal-6.x-siren-1.x/modules/dblog/dblog.module(130): drupal_write_record('watchdog', Object(stdClass)) #5 [internal function]: dblog_watchdog(Array) #6 /mnt/hswong3i/project/drupal/drupal-6.x-siren-1.x/includes/module.inc(450): call_user_func_array('dblog_watchdog', Array) #7 /mnt/hswong3i/project/drupal/drupal-6.x-siren-1.x/includes/bootstrap in /mnt/hswong3i/project/drupal/drupal-6.x-siren-1.x/includes/database.pdo_oci.inc on line 182

Fatal error: Exception thrown without a stack frame in Unknown on line 0

I guess the first ORA-01461 error is all due to pdo_oci mishandling on VARCHAR2(4000). When you search in google, you may found that similar errors were happened once before in JDBC, on 10gR2 and etc... As DB can setup successfully by oci8, there shouldn't be the bug of DB configuration nor programming logic. I will try to report this later ;-(

P.S. the interchangeable of drivers can also apply to MySQL's (mysql, mysqli and pdo_mysql) and PostgreSQL's (pgsql and pdo_pgsql). They are both functioning correctly ;-)


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <h1> <h2> <h3> <h4> <h5> <h6> <em> <strong> <code> <del> <blockquote> <q> <sub> <p> <br> <ul> <ol> <li> <dl> <dt> <dd> <a> <b> <u> <i> <sup> <acronym> <pre> <img>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.