473,385 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 1728
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 all stored procedures in just one database. I...
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 should be the same that the stored procedures...
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 platform. If I am on the linux box i can install...
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 version 7.2 with FP 9 It will be of really a...
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 at java jdbc samples as supplied with db2 and run...
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 packages (for code reuse). I encountered...
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 C#.NET and Microsoft SQL Server 2000 Production and...
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 will help you judge yourself are you really worth of...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.