472,341 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,341 software developers and data experts.

Java stored procedures on different dbs on same server

Following problem, hope someone can help us:
We have a testserver with three test-databases for each of our current
services (production servers are one machine per service). Having
three databse on one server worked without a problem (except from some
performance-issues...) till we created stored procedures with same
name (and different parameters) in two of the databases.

We use one .jar with the procedure's name to encapsulate all files
necessary for one procedure. But because DB2 only arranges the files
per user (in sqllib/function/jar/(username)) and NOT per database,
installing one procedure would overwrite the other. So I changed our
batch to install procedures so it would append the database's name to
the .jar, believing that this would solve the problem. Obviuosly it
did not. Although there are now individual .jar's for each database,
db2 seems to always load the class from the .jar first installed. So
if there are two .jars containing the same classes, there will only
one be used, no matter what .jar you specified. This undermines imo
the whole idea of having .jar files, because the java interpreter
should load exactly and only the classes of the .jar defined in CREATE
PROCEDURE.

Now does anybody know if this is a known issue or if there is somthing
wrong with our configuration. Has anyone a easy solution to this? Or
do we have to give a unique name to all our classes used for sps from
now on?

Thanks for your support

Janick
Nov 12 '05 #1
5 1657
This is a documented limitation...db2 will always pick up the first
matching class from the classpath.

Janick wrote:
Following problem, hope someone can help us:
We have a testserver with three test-databases for each of our current
services (production servers are one machine per service). Having
three databse on one server worked without a problem (except from some
performance-issues...) till we created stored procedures with same
name (and different parameters) in two of the databases.

We use one .jar with the procedure's name to encapsulate all files
necessary for one procedure. But because DB2 only arranges the files
per user (in sqllib/function/jar/(username)) and NOT per database,
installing one procedure would overwrite the other. So I changed our
batch to install procedures so it would append the database's name to
the .jar, believing that this would solve the problem. Obviuosly it
did not. Although there are now individual .jar's for each database,
db2 seems to always load the class from the .jar first installed. So
if there are two .jars containing the same classes, there will only
one be used, no matter what .jar you specified. This undermines imo
the whole idea of having .jar files, because the java interpreter
should load exactly and only the classes of the .jar defined in CREATE
PROCEDURE.

Now does anybody know if this is a known issue or if there is somthing
wrong with our configuration. Has anyone a easy solution to this? Or
do we have to give a unique name to all our classes used for sps from
now on?

Thanks for your support

Janick


Nov 12 '05 #2
Do you know if this is fixed with version 8.1?
Nov 12 '05 #3
It is not. There are plans to revise the JVM in v9 to lift this restriction.

Janick wrote:
Do you know if this is fixed with version 8.1?


Nov 12 '05 #4
ja******@gmx.ch (Janick) wrote in message news:<e7**************************@posting.google. com>...
Do you know if this is fixed with version 8.1?


I have been told this is going to be fixed in DB2 V9 that is comming
up somewhere in May 2004. The workarounds now would be to have all
your java classes named uniquely across the DB2 instance (that can be
automated by your app build/deploy process) or having a separate
instance for each applicatoin/developer (less feasible).

Eugene
Nov 12 '05 #5
eu****@profitlogic.com (Eugene) wrote in message news:<95**************************@posting.google. com>...
ja******@gmx.ch (Janick) wrote in message news:<e7**************************@posting.google. com>...
Do you know if this is fixed with version 8.1?
I have been told this is going to be fixed in DB2 V9 that is comming
up somewhere in May 2004.

May 2004? Didn't 8.1 just come out recently?
The workarounds now would be to have all
your java classes named uniquely across the DB2 instance (that can be
automated by your app build/deploy process)

I did exactly that. Had to change our batch. Now all procedures lie in
a unique package per db/project.

Hope IBM will fix this (they should already have done so) because it
is a really stupid behaviour to look in all jars for corresponding
class (especially when you explicitily provided a jar-name in
create-procedure).

Thanks for your help guys.
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Minh Tran | last post by:
In order to minimize the number of connection strings I have to use to access different databases on the same Sql Server, I was considering storing...
11
by: jrefactors | last post by:
I want to know the differences between SQL Server 2000 stored procedures and oracle stored procedures? Do they have different syntax? The concept...
7
by: Alex | last post by:
Hi all, I am trying to install a java stored procedure via the windows development centre. The linux box is running 8.1 FP4 as is the windoze...
1
by: Kumar | last post by:
Hi I am trying to recreate a database under the following environments : From: Solaris with DB2UDB version 7.2 with FP 9 To: Linux with DB2UDB...
1
by: Alex | last post by:
Hi all, Just been dabbling with java stored procedures and I'm having problems replacing System: db2 8.1.4 on RH 7.1 linux system 1). Look...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java...
28
by: mooreit | last post by:
The purpose for my questions is accessing these technologies from applications. I develop both applications and databases. Working with Microsoft...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.