Hi:
I use Drupal 7.8 and 7.x-1.9 Oracle driver.
I use mysql as primary database. Oracle is a external database where i do sql queries to show data.
When i enable/disable any module, i get the following message:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'DatabaseConnection_oracle-class' for key 'PRIMARY': INSERT INTO {registry} (name, type, filename, module, weight) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4), (:db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9), (:db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14); Array ( [:db_insert_placeholder_0] => DatabaseConnection_oracle [:db_insert_placeholder_1] => class [:db_insert_placeholder_2] => includes/database.inc [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => DatabaseStatement_oracle [:db_insert_placeholder_6] => class [:db_insert_placeholder_7] => includes/database.inc [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => 0 [:db_insert_placeholder_10] => DatabaseLongIdentifierHandler_oracle [:db_insert_placeholder_11] => class [:db_insert_placeholder_12] => includes/database.inc [:db_insert_placeholder_13] => [:db_insert_placeholder_14] => 0 ) in _registry_parse_file() (line 179 of includes\registry.inc).
Any idea to fix that problem?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Captura de pantalla 2011-09-28 a la(s) 22.21.45.png | 123.37 KB | Anonymous (not verified) |
Comments
Comment #1
aaaristo commentedi cannot see how the oracle module is involved in the module activation if you use mysql as primary store.
Comment #2
Anonymous (not verified) commentedHi:
I don't not what it happens, not only when I enable module, by example, when I click into "clear al caches" (at admin/config/development/performance) that error appears.
Another example:
I enabled a module "Localization update" and the message error appears again.
But when I click into "admin/config/regional/translate" I get a new error:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'titania.locales_target' doesn't exist: SELECT COUNT(*) AS translation, t.language, s.textgroup FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid GROUP BY textgroup, language; Array ( ) in locale_translate_overview_screen() (line 782 of C:\xampp\htdocs\drupal-7.8\modules\locale\locale.admin.inc).
The website encountered an unexpected error. Please try again later.
and the table doesn't exists
Any idea?
Comment #3
oshelot commentedSo MySQL is where the d7 installations is, correct? Can you specify how you are connecting to Oracle? I would think that all modules (that need it) use MySQL. So maybe the issue lies with how you configured the connection to Oracle.
Comment #4
Anonymous (not verified) commentedHi Osman.
Yes, mysql is where I have installed d7 .
I will develop a module to show a page with information obtained from oracle database.
But because this module isn't finished, I have created a block that connect to oracle database. At this moment, that block is disabled, and all error messages that I write on this post are with this block disabled. I don't understand why oracle messages appears with block disabled.
Comment #5
Anonymous (not verified) commentedFor more information, i show database configuration at settings.php:
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'titania',
'username' => 'user',
'password' => '*******',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
'oracle' =>
array (
'default' =>
array (
'database' => 'XE',
'username' => '*****',
'password' => '******',
'host' => '192.168.0.8',
'port' => '',
'driver' => 'oracle',
'prefix' => '',
),
),
);
And the php block code (the block only shows at /node/1 ):
db_set_active('oracle');
$sql = 'SELECT * FROM hr.employees';
$res = db_query($sql);
$res = (array) $res->fetchAll();
foreach ($res as $row) {
$row = (array) $row;
print ($row['last_name']."-".$row['email']);
}
db_set_active();
Comment #6
Anonymous (not verified) commentedand another sample:
When I enable a core module (Aggregator), the message error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'DatabaseConnection_oracle-class' for key 'PRIMARY': INSERT INTO {registry} (name, type, filename, module, weight) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4), (:db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9), (:db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14); Array ( [:db_insert_placeholder_0] => DatabaseConnection_oracle [:db_insert_placeholder_1] => class [:db_insert_placeholder_2] => includes/database.inc [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => DatabaseStatement_oracle [:db_insert_placeholder_6] => class [:db_insert_placeholder_7] => includes/database.inc [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => 0 [:db_insert_placeholder_10] => DatabaseLongIdentifierHandler_oracle [:db_insert_placeholder_11] => class [:db_insert_placeholder_12] => includes/database.inc [:db_insert_placeholder_13] => [:db_insert_placeholder_14] => 0 ) in _registry_parse_file() (line 179 of C:\xampp\htdocs\drupal-7.8\includes\registry.inc).
appears, and then, aggregator tables aren't created. When I go to admin/config/services/aggregator:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'titania.aggregator_feed' doesn't exist: SELECT f.fid, f.title, f.url, f.refresh, f.checked, f.link, f.description, f.hash, f.etag, f.modified, f.image, f.block, COUNT(i.iid) AS items FROM {aggregator_feed} f LEFT JOIN {aggregator_item} i ON f.fid = i.fid GROUP BY f.fid, f.title, f.url, f.refresh, f.checked, f.link, f.description, f.hash, f.etag, f.modified, f.image, f.block ORDER BY f.title; Array ( ) in aggregator_view() (line 22 of C:\xampp\htdocs\drupal-7.8\modules\aggregator\aggregator.admin.inc).
The website encountered an unexpected error. Please try again later.
Comment #7
oshelot commentedHi Daniel,
I have never attempted to use Drupal with multiple databases so I don't know how much useful info I can provide. However, if I was troubleshooting this issue I would start by doing the following.
1) remove everything I have done
2) verify that just adding the oracle instance configuration to settings.php doesn't disrupt anything - after all, it should never be used unless "db_set_active('oracle');" is used
3) If at this point everything with core modules and adding removing modules works properly, I would then attempt a query to oracle. In the module I would make sure to print. This seems to be what you did and it is producing errors so I would then begin to look at this.
-- Do you have a $db_url set for the Oracle instance
-- maybe try using the 'db_driver' function to print out which DB is active before and after the db_set_active functions to make sure the DB instances are being switched properly throughout the running of the module.
Good luck!
Comment #8
Anonymous (not verified) commentedHi Oshman,
Thanks for your answer. I did a new installation and the problem persists.
If I delete oracle folder from "includes", the installation it's ok, without any
error. For install any module, I need to delete that folder, and copy again to "includes" folder. If I do that, when a enable a module and that module needs to do a table creation, it's ok. If the oracle folder(and files :D) exists at "includes", shows the error and don't create table at mysql.
I will try to using the 'db_driver', but at my module everithing is ok and shows the external data from Oracle. It's when i do normal task with drupal (enable modules, etc) when i get the error. I could try to put db_driver at drupal core, but i don't know where
Comment #9
aaaristo commentedlooks like a core bug to me... moving it
Comment #10
Anonymous (not verified) commentedComment #11
neelanjana das commentedI am getting the same error in mysql. I am not using oracle