Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Oracle error ORA-12154 with jdbc driver

Posted on 2006-06-07
22
Medium Priority
?
1,185 Views
Last Modified: 2008-01-09
We are running a server Oracle 8.1.7
The client has the Oracle 8.1.7 client as well
The application uses jdbc (java is 1.4.2) with the classes12.zip provided by Oracle (at client installation)
However, we often get the following error : ORA-12154 could not resolve service name
The problem is intermittent, which I suspect to be a bug in the driver.
Can somebody tell me the precise jdbc version to use and how to know about it ?
0
Comment
Question by:LeTay
  • 7
  • 5
  • 5
  • +2
21 Comments
 
LVL 19

Expert Comment

by:actonwang
ID: 16851990
classes12.zip is the right jar file to use.

if you get this error intermittent, it might be a network problem. you could turn on sql*net trace file or look at the log file to see if any problem.
0
 
LVL 48

Expert Comment

by:schwertner
ID: 16852294
As a workaround, you can hardcode the full tns description in the
JDBC/OCI connection string. This avoids the need to read the tnsnames.ora file.
This will not eliminate the problem, but should free up more file descriptors for
your use, thus deferring failure until later.

jdbc:oracle:oci8:@(description=(address=(host=pepper)(protocol=tcp)(port=1521))(connect_data=(sid=ORCL)))

is this Sun Solaris?
200253.1
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16852358
why don't you thin client as:

jdbc:oracle:thin:user/pass@<host>:1521:<db name>

it can avoid the service name.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:LeTay
ID: 16852847
In fact we had the same problem on a separated system (test) running Oracle 9.
The jdbc driver appeared to be buggy and had to be changed.
On the other hand, when there are connection problems, other messages are stacked.
So ?
0
 

Author Comment

by:LeTay
ID: 16852878
It is indeed on a Sun Solaris that the client runs
I don't think we can "easily" go without the service name in this application
To say more about this, it is an application that we sell and which is not causing problem, except at one customer site.
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16852921
0
 
LVL 48

Accepted Solution

by:
schwertner earned 2000 total points
ID: 16859147
If this is Sun Solaris then everything is clear.
This is a known Solaris bug (1084772). Contact Sun for further information and/or
possible patch.
Explanation:
The OS file descriptor limit is being reached. Thus, the tnsnames.ora file cannot
be read to resolve the tns alias suppled to the connection string.


0
 

Author Comment

by:LeTay
ID: 16859372
I thought that in this case, we should receive an error somewhere like 'too many open files' ?
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16860062
look at the metalink and it seems to have some workaround
0
 
LVL 48

Expert Comment

by:schwertner
ID: 16868973
This is the exaxt diagnosys of your situation.
It happens close to 257 connection to the Sun Solaris Server.
Make a request to Sun for workaround.
Oracle is aware for this bug.
0
 
LVL 1

Expert Comment

by:primusmagestri
ID: 16900373
Come on, actonwang gave you the perfect (at least temporary) solution - use THIN driver instead of OCI.
0
 

Author Comment

by:LeTay
ID: 16900545
Unfortunately our software has not been tested with the thin driver...
0
 
LVL 1

Expert Comment

by:primusmagestri
ID: 16900579
well, test it as soon as possible, for me it doesn't sound reasonable to have ORA-12154 could not resolve service name popping from time to time. anyway, there shouldn't be great differences in execution between OCI and THIN.
0
 
LVL 48

Expert Comment

by:schwertner
ID: 16910765
THIN will open the same connections and of course will read tnsnames.ora, because it also uses connection string that has to be
read from tnsname.ora to be solved.
Another workarount is to put in sqlnet.ora file the line
SQLNET.EXPIRE_TIME = 10

This will delete every 10 minites dead sessions and
if you have luck will decrease the open connections.
0
 
LVL 1

Expert Comment

by:primusmagestri
ID: 16911048
>>THIN will open the same connections and of course will read tnsnames.ora, because it also uses connection string that has to be
read from tnsname.ora to be solved

please explain this, schwertner...

plus, you first suggested that it's a problem with files being opened and now you're claiming it's about too many (database?) connections? you lost me...
0
 

Author Comment

by:LeTay
ID: 16911073
Friends,
I think that the real problem is a (known) bug in the JBoss middleware that we use for accessing the RDBMS.
Most likely the JBoss does not always do a clean job and the problem occurs, randomly...
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16911271
What jboss version you have? I guess that you have jboss3...
0
 

Author Comment

by:LeTay
ID: 16911374
JBoss 3.2.3
Says that fix is with JBoss 3.2.6
0
 

Author Comment

by:LeTay
ID: 16911415
Sorry I mixed up 2 problem
Forget about JBoss bug

Schwertner, why do you think it is a Sun Solaris bug ?
What is exactly the limitation ?
Our configuration does not open more than 50 connections to Oracle,
So this is very below your 255 figure...
0
 
LVL 48

Expert Comment

by:schwertner
ID: 16932352
Hello LeTay,

I have posted the whole information I have.
If you need evidence, please send me an email.
There are some restrictions that prevent me to
post it here.

Be aware that this OS limitation really exists and is sorted as Sun bug.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20286439
Forced accept.

Computer101
EE Admin
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question