My company had developed a system that had been running in Sweden for years. Platform: Java, Weblogic, Oracle.
Recently, we decided to upgrade the Oracle thin driver from version 9 to 10.
Right after restart, we experienced a really odd problem: getConnection() calls failed with "Locale not recognized" error.
First I thought there is something to do with the database supported locale, partly because now we have to use orai18n.jar instead of orcs12.jar, but it was not the case.
This is the way to find out database locale settings:
select * from SYS.NLS_DATABASE_PARAMETERS
It was nothing Sweden specific, so there should be no problem with the database locale.
Then, I decided to debug the Oracle driver (credits to JadClipse ), and it turned out that Oracle 10 driver has something like this inside:
String s9 = CharacterSetMetaData.getNLSLanguage(Locale.getDefault());
if (s9==null) throw ....
...and this is where the exception caught comes from.
Ok, we are really close now.
Locale.getDefault() resulted locale se_SE.
(We are using different language resource files, and we set the default locale to this after reading the configs.)
But hey, shouldn't CharacterSetMetaData.getNLSLanguage support se_SE?
Actually, it shouldn't. Just check out the list of Supported Locales by Sun. It is sv_SE and not se_SE!! LOL!!
Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts
2008-03-19
2007-01-15
Weblogic - Oracle DB transaction inconsistency
I was kind of surprised when I read this article about Oracle commititng transactions on connection close().
Currently we've are facing a problem with BEA Weblogic 8.1 sp4 connecting to Oracle DB. When the connection had problems, the first part of the user transaction got to the database, even without explicitely calling either commit(), or close().
Probably Weblogic implicitely calls close() which commits the user transactions. This nasty problem has been escalated to BEA support, I'll update you with the outcome.
Currently we've are facing a problem with BEA Weblogic 8.1 sp4 connecting to Oracle DB. When the connection had problems, the first part of the user transaction got to the database, even without explicitely calling either commit(), or close().
Probably Weblogic implicitely calls close() which commits the user transactions. This nasty problem has been escalated to BEA support, I'll update you with the outcome.
2006-12-19
Oracle 8 CLOB problem with Thin driver solved
Project: workflow system for major telecom company
Technologies: Java 5, Ajax(Echo2), Weblogic, jBpm, Hibernate
The problem: we have to connect to an Oracle 8.1.7 database and we have been experiencing all kind of weird stuff depending on the driver we were using.
Dispite Oracle states that all current drivers are compatible with (Oracle says: can talk to:) RDBMS 8.1.7, we had to face several incompatibility issues.
First we tried to use the latest 10g thin drivers. Everything went well until we tried to use a CLOB field to store special Hungarian text (árvíztűrőtükörfúrógép). We were unable to retrieve anything better that ?rv?zt?r?t?k?rf?r?g?p using JDBC, although TOAD showed the inserted values perfectly.
Then we switched to version 8 thin driver which proved to be the only Oracle JDBC thin driver capable of retrieving Hungarian chars from CLOB fields of a 8.1.7 database.
Things got worse when the text size increased, suddenly we started to receive this:
java.sql.SQLException: operation not allowed: streams type cannot be used in batching
It seems that the old JDBC driver does not support batch updates of Hibernate, therefore we disabled the batch update feature: hibernate.jdbc.batch_size=0
It didn't help. At the moment of DB connection closing, we got a deadlock... Awesome... What next?
Final attepmt: we switched to the OCI driver and it works well.
Conclusion: if you need to use CLOB fields with Oracle 8, your recommended choice is the OCI driver.
Technologies: Java 5, Ajax(Echo2), Weblogic, jBpm, Hibernate
The problem: we have to connect to an Oracle 8.1.7 database and we have been experiencing all kind of weird stuff depending on the driver we were using.
Dispite Oracle states that all current drivers are compatible with (Oracle says: can talk to:) RDBMS 8.1.7, we had to face several incompatibility issues.
First we tried to use the latest 10g thin drivers. Everything went well until we tried to use a CLOB field to store special Hungarian text (árvíztűrőtükörfúrógép). We were unable to retrieve anything better that ?rv?zt?r?t?k?rf?r?g?p using JDBC, although TOAD showed the inserted values perfectly.
Then we switched to version 8 thin driver which proved to be the only Oracle JDBC thin driver capable of retrieving Hungarian chars from CLOB fields of a 8.1.7 database.
Things got worse when the text size increased, suddenly we started to receive this:
java.sql.SQLException: operation not allowed: streams type cannot be used in batching
It seems that the old JDBC driver does not support batch updates of Hibernate, therefore we disabled the batch update feature: hibernate.jdbc.batch_size=0
It didn't help. At the moment of DB connection closing, we got a deadlock... Awesome... What next?
Final attepmt: we switched to the OCI driver and it works well.
Conclusion: if you need to use CLOB fields with Oracle 8, your recommended choice is the OCI driver.
Subscribe to:
Posts (Atom)