You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Sebastian Pfaff <se...@gmail.com> on 2008/05/12 17:08:38 UTC

can't remove jar file from database (ERROR X0X13)!!!

Hello,

how can i see which jars are included in my database? I want to see
all jars which are added through a call of 'CALL sqlj.install_jar
[...]'.

the main problem is:

yesterday i added a jar to my database via the call of:

ij> CALL sqlj.install_jar('/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
'APP.Sample1', 0);

Notice: [...]Pojects[...] is a typo but that is ok!!!

You can see the jar in the filesystem:

ls DATACENTER/SM_DATA_LAYER/jar/APP/
SAMPLE1.jar.G1210431624637

today i tried to remove the jar via a call of:

ij> CALL sqlj.remove_jar('APP.Sample1', 0);

The call above always produces this errror:

ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.

here the server side stacktrace:

2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
NF000001.DF1C-1025975079512780256{2}), Cleanup action starting
2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
NF000001.DF1C-1025975079512780256{2}), Failed Statement is: CALL
sqlj.remove_jar('APP.Sample1', 0)
ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
        at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown Source)
        at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown Source)
        at org.apache.derby.catalog.SystemProcedures.REMOVE_JAR(Unknown Source)
        at org.apache.derby.exe.acf81e0010x0119xdd3bxc79bx00001d72cbbd1b.g0(Unknown
Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown
Source)
        at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown
Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
Source)
        at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown
Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
Source)
        at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown Source)
        at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
Source)
        at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
Source)
        at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
Cleanup action completed

If i'm trying to include/install an additional jar file everything works fine:

ij> CALL sqlj.install_jar(
    '/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
'APP.Sample1', 0);
> Statement executed.

here layout of filesystem before removing:

ls DATACENTER/SM_DATA_LAYER/jar/APP/
SAMPLE1.jar.G1210431624637  SAMPLE1.jar.G1210597561003

ij> CALL sqlj.remove_jar('APP.Sample1', 0);
Statement executed.
ij>

layout just after removing:

ls DATACENTER/SM_DATA_LAYER/jar/APP/
SAMPLE1.jar.G1210431624637

It seems to be impossible to remove the file named
'SAMPLE1.jar.G1210431624637'! It would be nice to know, how to make
included/installed jars visible and how to remove them if a call of
sqlj.remove_jar fails.

Is it save to remove the file manually from filesystem (e.g. rm
SAMPLE1.jar.G1210431624637)?

my environment is:

Linux 2.6.25.1 && java version "1.6.0_06 && derby 10.4


If you need additional infos, please let me know. Any help is appreciated.

TNX in advance!

Sebastian

Re: can't remove jar file from database (ERROR X0X13)!!!

Posted by Sebastian Pfaff <se...@gmail.com>.
Hi Rick,

i already tried this too. But i can't reproduce it. It is only this on.

When i install a new jar file, like in the case below everything works fine.

[In IJ]
ij> CALL sqlj.install_jar('/home/me/netBeansProjects/java/DatabaseRoutines/dist/DatabaseRoutines.jar',
'APP.SAMPLE2', 0);
Statement executed.

[On file system]
ls DATACENTER/SM_DATA_LAYER/jar/APP/
SAMPLE1.jar.G1210431624637  SAMPLE2.jar.G1210696701

[In IJ]
ij> CALL sqlj.remove_jar('APP.Sample2', 0);
Statement executed.

[On file system]
sam:~# ls DATACENTER/SM_DATA_LAYER/jar/APP/
SAMPLE1.jar.G1210431624637

//REMEMBER: SAMPLE1.jar.G1210431624637 is the problematic one

Probably i closed the database improper. Yesterday i closed the
database implicit by executing the Unix/Linux halt command. Maybe this
has produced the "error".

Regards && tnx for *very fast* answer! :-]

Sebastian


On Tue, May 13, 2008 at 6:41 PM, Rick Hillegas <Ri...@sun.com> wrote:
> Thanks, Sebastian. This sounds like a bug. Can you reproduce this problem
> reliably (e.g., install then remove a jar file in such a way that it
> disappears from the catalogs but remains under the database directory)?
>
>
>
>  Thanks,
>  -Rick
>
>  Sebastian Pfaff wrote:
>
> > Hi Rick,
> >
> > i explicitly  closed everything which is related to java (including
> > the derby database server), but the file SAMPLE1.jar.G1210431624637
> > STLL RESIDES (!!!) in the directory. I can't see the file inside the
> > database, but it exists in the file system.
> >
> > I already tried this before  I'm working on a desktop machine and
> > after every reboot every processes will be closed. The effect is
> > always the same :(
> >
> > Regards && tnx for answer :-]
> >
> > Sebastian
> >
> >
> > On Tue, May 13, 2008 at 3:30 PM, Rick Hillegas <Ri...@sun.com>
> wrote:
> >
> >
> > > Thanks for the detailed explanation, Sebastian. Now I think I am
> tracking
> > > you.
> > >
> > >  The situation you describe sounds odd to me. If you bring down the VM
> which
> > > is running the database, does the orphaned copy of the jar file
> disappear
> > > from the subdirectory  under the database directory?
> > >
> > >  Thanks,
> > >
> > >
> > >  -Rick
> > >
> > >  Sebastian Pfaff wrote:
> > >
> > >
> > >
> > > > Hi Rick,
> > > >
> > > > tnx for your answer, i think you understood everything. I'm writing
> > > > this mail just to clarify things.
> > > >
> > > > My initial problem is: I installed a jar file (via install_jar
> > > > command). And i cannot remove it with remove_jar command. But the jar
> > > > file resides in the jar directory of the database. If i'm trying to
> > > > delete the jar file i get this error:
> > > >
> > > > ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
> > > >
> > > > So i wanted to know, if it's possible to delete the jar file manually
> > > > from file system. The thing i want to do is something like this:
> > > >
> > > > rm
> /home/me/DATACENTER/SM_DATA_LAYER/jar/APP/SAMPLE1.jar.G1210431624637
> > > >
> > > > But i'm not sure if this command will create inconsistencies within
> > > > the database and something gets broken inside the database.
> > > >
> > > > If i'm right informed every jar file which is installed inside the
> > > > database will be stored in the jar directory of the database (e.g.
> > > > My_databse/jar). If i'm wrong, please correct me.
> > > >
> > > > Regards
> > > >
> > > > Sebastian Pfaff
> > > >
> > > >
> > > >
> > > > On Tue, May 13, 2008 at 12:54 AM, Rick Hillegas
> > > > <Ri...@sun.com> wrote:
> > > >
> > > >
> > > >
> > > >
> > > > > Hi Sebastian,
> > > > >
> > > > >  I'm not sure I'm understanding your question. Please bear with me.
> The
> > > > > install_jar command copies the jar file from the file system into
> the
> > > > > database. The remove_jar command deletes the jar file from the
> database.
> > > > > Neither command alters the external file system. If you need to
> delete
> > > > >
> > > > >
> > > >
> > > an
> > >
> > >
> > > >
> > > > > obsolete jar file from the file system, you can use ordinary
> operating
> > > > > system commands.
> > > > >
> > > > >
> > > > >
> > > > >  Hope this helps,
> > > > >  -Rick
> > > > >
> > > > >  Sebastian Pfaff wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Hi Rick,
> > > > > >
> > > > > > tnx for your answer! Your snippet works fine (if i install/include
> a
> > > > > > new jar file, your snippet shows me this). But when i have NO NEW
> > > > > > ADDTIONIAL jars in my database installed and if i'm executing your
> SQL
> > > > > > snippet:
> > > > > >
> > > > > > ij> SELECT s.schemaname, f.filename FROM sys.sysschemas s,
> > > > > > sys.sysfiles f WHERE s.schemaid = f.schemaid
> > > > > >
> > > > > > i get this result:
> > > > > >
> > > > > > SCHEMANAME
> > > > > >                                                       |FILENAME
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > > 0 rows selected
> > > > > >
> > > > > > the jar file ISN'T listed here (!!!), but the jar file
> > > > > > SAMPLE1.jar.G1210431624637  _IS_STILL_ in the filesystem:
> > > > > >
> > > > > > ls SM_DATA_LAYER/jar/APP/
> > > > > > SAMPLE1.jar.G1210431624637
> > > > > >
> > > > > > So i have only one question:
> > > > > >
> > > > > > How can i remove this jar file (Would it be save to remove the jar
> > > > > > file via a manual delete on the filesystem?)?
> > > > > >
> > > > > > Regards && tnx in advance
> > > > > >
> > > > > > Sebastian
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Mon, May 12, 2008 at 6:23 PM, Rick Hillegas
> > > > > >
> > > > > >
> > > > >
> > > >
> > > <Ri...@sun.com>
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > >
> > > > > wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > >
> > > > > > > Hi Sebastian,
> > > > > > >
> > > > > > >  The following query will show you the names of the jar files
> loaded
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > into
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > > your database:
> > > > > > >
> > > > > > >  select s.schemaname, f.filename
> > > > > > >  from sys.sysschemas s, sys.sysfiles f
> > > > > > >  where s.schemaid=f.schemaid
> > > > > > >
> > > > > > >  So, for instance, the following script runs like this for me:
> > > > > > >
> > > > > > >  ij> call sqlj.install_jar( '/Users/rhillegas/junk/z.txt',
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > 'APP.Foo', 0
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > );
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >  0 rows inserted/updated/deleted
> > > > > > >  ij> select s.schemaname, f.filename
> > > > > > >  from sys.sysschemas s, sys.sysfiles f
> > > > > > >  where s.schemaid=f.schemaid
> > > > > > >  ;
> > > > > > >  SCHEMANAME
> > > > > > > |FILENAME
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >  APP
> > > > > > > |FOO
> > > > > > >
> > > > > > >  1 row selected
> > > > > > >  ij> call sqlj.remove_jar( 'APP.Foo', 0 );
> > > > > > >  0 rows inserted/updated/deleted
> > > > > > >  ij> select s.schemaname, f.filename
> > > > > > >  from sys.sysschemas s, sys.sysfiles f
> > > > > > >  where s.schemaid=f.schemaid
> > > > > > >  ;
> > > > > > >  SCHEMANAME
> > > > > > > |FILENAME
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >  0 rows selected
> > > > > > >
> > > > > > >  Hope this helps,
> > > > > > >  -Rick
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >  Sebastian Pfaff wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > how can i see which jars are included in my database? I want
> to
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > see
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > > all jars which are added through a call of 'CALL
> sqlj.install_jar
> > > > > > > > [...]'.
> > > > > > > >
> > > > > > > > the main problem is:
> > > > > > > >
> > > > > > > > yesterday i added a jar to my database via the call of:
> > > > > > > >
> > > > > > > > ij> CALL
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> sqlj.install_jar('/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > 'APP.Sample1', 0);
> > > > > > > >
> > > > > > > > Notice: [...]Pojects[...] is a typo but that is ok!!!
> > > > > > > >
> > > > > > > > You can see the jar in the filesystem:
> > > > > > > >
> > > > > > > > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > > > > > > > SAMPLE1.jar.G1210431624637
> > > > > > > >
> > > > > > > > today i tried to remove the jar via a call of:
> > > > > > > >
> > > > > > > > ij> CALL sqlj.remove_jar('APP.Sample1', 0);
> > > > > > > >
> > > > > > > > The call above always produces this errror:
> > > > > > > >
> > > > > > > > ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema
> 'APP'.
> > > > > > > >
> > > > > > > > here the server side stacktrace:
> > > > > > > >
> > > > > > > > 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main]
> (XID =
> > > > > > > > 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
> > > > > > > > NF000001.DF1C-1025975079512780256{2}), Cleanup action starting
> > > > > > > > 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main]
> (XID =
> > > > > > > > 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
> > > > > > > > NF000001.DF1C-1025975079512780256{2}), Failed Statement is:
> CALL
> > > > > > > > sqlj.remove_jar('APP.Sample1', 0)
> > > > > > > > ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema
> 'APP'.
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> org.apache.derby.iapi.error.StandardException.newException(Unknown
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > Source)
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > >     at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > Source)
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > org.apache.derby.catalog.SystemProcedures.REMOVE_JAR(Unknown
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > Source)
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > org.apache.derby.exe.acf81e0010x0119xdd3bxc79bx00001d72cbbd1b.g0(Unknown
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > Method)
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > > >     at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at
> org.apache.derby.impl.drda.DRDAStatement.execute(Unknown
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > Source)
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Source)
> > > > > > > >     at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > Source)
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > > Cleanup action completed
> > > > > > > >
> > > > > > > > If i'm trying to include/install an additional jar file
> everything
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > works
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > fine:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > ij> CALL sqlj.install_jar(
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > '/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > > 'APP.Sample1', 0);
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > > Statement executed.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > here layout of filesystem before removing:
> > > > > > > >
> > > > > > > > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > > > > > > > SAMPLE1.jar.G1210431624637  SAMPLE1.jar.G1210597561003
> > > > > > > >
> > > > > > > > ij> CALL sqlj.remove_jar('APP.Sample1', 0);
> > > > > > > > Statement executed.
> > > > > > > > ij>
> > > > > > > >
> > > > > > > > layout just after removing:
> > > > > > > >
> > > > > > > > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > > > > > > > SAMPLE1.jar.G1210431624637
> > > > > > > >
> > > > > > > > It seems to be impossible to remove the file named
> > > > > > > > 'SAMPLE1.jar.G1210431624637'! It would be nice to know, how to
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > make
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > > included/installed jars visible and how to remove them if a
> call
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > of
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > > sqlj.remove_jar fails.
> > > > > > > >
> > > > > > > > Is it save to remove the file manually from filesystem (e.g.
> rm
> > > > > > > > SAMPLE1.jar.G1210431624637)?
> > > > > > > >
> > > > > > > > my environment is:
> > > > > > > >
> > > > > > > > Linux 2.6.25.1 && java version "1.6.0_06 && derby 10.4
> > > > > > > >
> > > > > > > >
> > > > > > > > If you need additional infos, please let me know. Any help is
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > appreciated.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > > TNX in advance!
> > > > > > > >
> > > > > > > > Sebastian
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

Re: can't remove jar file from database (ERROR X0X13)!!!

Posted by Rick Hillegas <Ri...@Sun.COM>.
Thanks, Sebastian. This sounds like a bug. Can you reproduce this 
problem reliably (e.g., install then remove a jar file in such a way 
that it disappears from the catalogs but remains under the database 
directory)?

Thanks,
-Rick

Sebastian Pfaff wrote:
> Hi Rick,
>
> i explicitly  closed everything which is related to java (including
> the derby database server), but the file SAMPLE1.jar.G1210431624637
> STLL RESIDES (!!!) in the directory. I can't see the file inside the
> database, but it exists in the file system.
>
> I already tried this before  I'm working on a desktop machine and
> after every reboot every processes will be closed. The effect is
> always the same :(
>
> Regards && tnx for answer :-]
>
> Sebastian
>
>
> On Tue, May 13, 2008 at 3:30 PM, Rick Hillegas <Ri...@sun.com> wrote:
>   
>> Thanks for the detailed explanation, Sebastian. Now I think I am tracking
>> you.
>>
>>  The situation you describe sounds odd to me. If you bring down the VM which
>> is running the database, does the orphaned copy of the jar file disappear
>> from the subdirectory  under the database directory?
>>
>>  Thanks,
>>
>>
>>  -Rick
>>
>>  Sebastian Pfaff wrote:
>>
>>     
>>> Hi Rick,
>>>
>>> tnx for your answer, i think you understood everything. I'm writing
>>> this mail just to clarify things.
>>>
>>> My initial problem is: I installed a jar file (via install_jar
>>> command). And i cannot remove it with remove_jar command. But the jar
>>> file resides in the jar directory of the database. If i'm trying to
>>> delete the jar file i get this error:
>>>
>>> ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
>>>
>>> So i wanted to know, if it's possible to delete the jar file manually
>>> from file system. The thing i want to do is something like this:
>>>
>>> rm /home/me/DATACENTER/SM_DATA_LAYER/jar/APP/SAMPLE1.jar.G1210431624637
>>>
>>> But i'm not sure if this command will create inconsistencies within
>>> the database and something gets broken inside the database.
>>>
>>> If i'm right informed every jar file which is installed inside the
>>> database will be stored in the jar directory of the database (e.g.
>>> My_databse/jar). If i'm wrong, please correct me.
>>>
>>> Regards
>>>
>>> Sebastian Pfaff
>>>
>>>
>>>
>>> On Tue, May 13, 2008 at 12:54 AM, Rick Hillegas
>>> <Ri...@sun.com> wrote:
>>>
>>>
>>>       
>>>> Hi Sebastian,
>>>>
>>>>  I'm not sure I'm understanding your question. Please bear with me. The
>>>> install_jar command copies the jar file from the file system into the
>>>> database. The remove_jar command deletes the jar file from the database.
>>>> Neither command alters the external file system. If you need to delete
>>>>         
>> an
>>     
>>>> obsolete jar file from the file system, you can use ordinary operating
>>>> system commands.
>>>>
>>>>
>>>>
>>>>  Hope this helps,
>>>>  -Rick
>>>>
>>>>  Sebastian Pfaff wrote:
>>>>
>>>>
>>>>
>>>>         
>>>>> Hi Rick,
>>>>>
>>>>> tnx for your answer! Your snippet works fine (if i install/include a
>>>>> new jar file, your snippet shows me this). But when i have NO NEW
>>>>> ADDTIONIAL jars in my database installed and if i'm executing your SQL
>>>>> snippet:
>>>>>
>>>>> ij> SELECT s.schemaname, f.filename FROM sys.sysschemas s,
>>>>> sys.sysfiles f WHERE s.schemaid = f.schemaid
>>>>>
>>>>> i get this result:
>>>>>
>>>>> SCHEMANAME
>>>>>                                                        |FILENAME
>>>>>
>>>>>
>>>>>
>>>>>           
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>     
>>>>         
>>>>> 0 rows selected
>>>>>
>>>>> the jar file ISN'T listed here (!!!), but the jar file
>>>>> SAMPLE1.jar.G1210431624637  _IS_STILL_ in the filesystem:
>>>>>
>>>>> ls SM_DATA_LAYER/jar/APP/
>>>>> SAMPLE1.jar.G1210431624637
>>>>>
>>>>> So i have only one question:
>>>>>
>>>>> How can i remove this jar file (Would it be save to remove the jar
>>>>> file via a manual delete on the filesystem?)?
>>>>>
>>>>> Regards && tnx in advance
>>>>>
>>>>> Sebastian
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Mon, May 12, 2008 at 6:23 PM, Rick Hillegas
>>>>>           
>> <Ri...@sun.com>
>>     
>>>>>           
>>>> wrote:
>>>>
>>>>
>>>>         
>>>>>           
>>>>>> Hi Sebastian,
>>>>>>
>>>>>>  The following query will show you the names of the jar files loaded
>>>>>>
>>>>>>
>>>>>>             
>>>> into
>>>>
>>>>
>>>>         
>>>>>> your database:
>>>>>>
>>>>>>  select s.schemaname, f.filename
>>>>>>  from sys.sysschemas s, sys.sysfiles f
>>>>>>  where s.schemaid=f.schemaid
>>>>>>
>>>>>>  So, for instance, the following script runs like this for me:
>>>>>>
>>>>>>  ij> call sqlj.install_jar( '/Users/rhillegas/junk/z.txt',
>>>>>>             
>> 'APP.Foo', 0
>>     
>>>>>>             
>>>> );
>>>>
>>>>
>>>>         
>>>>>>  0 rows inserted/updated/deleted
>>>>>>  ij> select s.schemaname, f.filename
>>>>>>  from sys.sysschemas s, sys.sysfiles f
>>>>>>  where s.schemaid=f.schemaid
>>>>>>  ;
>>>>>>  SCHEMANAME
>>>>>> |FILENAME
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>     
>>>>         
>>>>>>  APP
>>>>>> |FOO
>>>>>>
>>>>>>  1 row selected
>>>>>>  ij> call sqlj.remove_jar( 'APP.Foo', 0 );
>>>>>>  0 rows inserted/updated/deleted
>>>>>>  ij> select s.schemaname, f.filename
>>>>>>  from sys.sysschemas s, sys.sysfiles f
>>>>>>  where s.schemaid=f.schemaid
>>>>>>  ;
>>>>>>  SCHEMANAME
>>>>>> |FILENAME
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>     
>>>>         
>>>>>>  0 rows selected
>>>>>>
>>>>>>  Hope this helps,
>>>>>>  -Rick
>>>>>>
>>>>>>
>>>>>>
>>>>>>  Sebastian Pfaff wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Hello,
>>>>>>>
>>>>>>> how can i see which jars are included in my database? I want to
>>>>>>>               
>> see
>>     
>>>>>>> all jars which are added through a call of 'CALL sqlj.install_jar
>>>>>>> [...]'.
>>>>>>>
>>>>>>> the main problem is:
>>>>>>>
>>>>>>> yesterday i added a jar to my database via the call of:
>>>>>>>
>>>>>>> ij> CALL
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>> sqlj.install_jar('/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
>>     
>>>>         
>>>>>>             
>>>>>>> 'APP.Sample1', 0);
>>>>>>>
>>>>>>> Notice: [...]Pojects[...] is a typo but that is ok!!!
>>>>>>>
>>>>>>> You can see the jar in the filesystem:
>>>>>>>
>>>>>>> ls DATACENTER/SM_DATA_LAYER/jar/APP/
>>>>>>> SAMPLE1.jar.G1210431624637
>>>>>>>
>>>>>>> today i tried to remove the jar via a call of:
>>>>>>>
>>>>>>> ij> CALL sqlj.remove_jar('APP.Sample1', 0);
>>>>>>>
>>>>>>> The call above always produces this errror:
>>>>>>>
>>>>>>> ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
>>>>>>>
>>>>>>> here the server side stacktrace:
>>>>>>>
>>>>>>> 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
>>>>>>> 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
>>>>>>> NF000001.DF1C-1025975079512780256{2}), Cleanup action starting
>>>>>>> 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
>>>>>>> 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
>>>>>>> NF000001.DF1C-1025975079512780256{2}), Failed Statement is: CALL
>>>>>>> sqlj.remove_jar('APP.Sample1', 0)
>>>>>>> ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> org.apache.derby.iapi.error.StandardException.newException(Unknown
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Source)
>>>>>>>      at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown
>>>>>>>
>>>>>>>
>>>>>>>               
>>>> Source)
>>>>
>>>>
>>>>         
>>>>>>>      at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown
>>>>>>>
>>>>>>>
>>>>>>>               
>>>> Source)
>>>>
>>>>
>>>>         
>>>>>>>      at
>>>>>>>               
>> org.apache.derby.catalog.SystemProcedures.REMOVE_JAR(Unknown
>>     
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> Source)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>> org.apache.derby.exe.acf81e0010x0119xdd3bxc79bx00001d72cbbd1b.g0(Unknown
>>     
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Source)
>>>>>>>      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>>>               
>> Method)
>>     
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>     
>>>>         
>>>>>>             
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>     
>>>>         
>>>>>>             
>>>>>>>      at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Source)
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>> org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown
>>     
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Source)
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Source)
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Source)
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
>>     
>>>>         
>>>>>>             
>>>>>>> Source)
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>> org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown
>>     
>>>>         
>>>>>>             
>>>>>>> Source)
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Source)
>>>>>>>      at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown
>>>>>>>
>>>>>>>
>>>>>>>               
>>>> Source)
>>>>
>>>>
>>>>         
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>               
>>>> org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
>>>>
>>>>
>>>>         
>>>>>>> Source)
>>>>>>>      at
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Source)
>>>>>>>      at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown
>>>>>>>               
>> Source)
>>     
>>>>>>> Cleanup action completed
>>>>>>>
>>>>>>> If i'm trying to include/install an additional jar file everything
>>>>>>>
>>>>>>>
>>>>>>>               
>>>> works
>>>>
>>>>
>>>>         
>>>>>>>               
>>>>>> fine:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> ij> CALL sqlj.install_jar(
>>>>>>>
>>>>>>>               
>> '/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
>>     
>>>>>>> 'APP.Sample1', 0);
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>>> Statement executed.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                 
>>>>>>> here layout of filesystem before removing:
>>>>>>>
>>>>>>> ls DATACENTER/SM_DATA_LAYER/jar/APP/
>>>>>>> SAMPLE1.jar.G1210431624637  SAMPLE1.jar.G1210597561003
>>>>>>>
>>>>>>> ij> CALL sqlj.remove_jar('APP.Sample1', 0);
>>>>>>> Statement executed.
>>>>>>> ij>
>>>>>>>
>>>>>>> layout just after removing:
>>>>>>>
>>>>>>> ls DATACENTER/SM_DATA_LAYER/jar/APP/
>>>>>>> SAMPLE1.jar.G1210431624637
>>>>>>>
>>>>>>> It seems to be impossible to remove the file named
>>>>>>> 'SAMPLE1.jar.G1210431624637'! It would be nice to know, how to
>>>>>>>               
>> make
>>     
>>>>>>> included/installed jars visible and how to remove them if a call
>>>>>>>               
>> of
>>     
>>>>>>> sqlj.remove_jar fails.
>>>>>>>
>>>>>>> Is it save to remove the file manually from filesystem (e.g. rm
>>>>>>> SAMPLE1.jar.G1210431624637)?
>>>>>>>
>>>>>>> my environment is:
>>>>>>>
>>>>>>> Linux 2.6.25.1 && java version "1.6.0_06 && derby 10.4
>>>>>>>
>>>>>>>
>>>>>>> If you need additional infos, please let me know. Any help is
>>>>>>>
>>>>>>>
>>>>>>>               
>>>> appreciated.
>>>>
>>>>
>>>>         
>>>>>>> TNX in advance!
>>>>>>>
>>>>>>> Sebastian
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>             
>>>>         
>>     


Re: can't remove jar file from database (ERROR X0X13)!!!

Posted by Sebastian Pfaff <se...@gmail.com>.
Hi Rick,

i explicitly  closed everything which is related to java (including
the derby database server), but the file SAMPLE1.jar.G1210431624637
STLL RESIDES (!!!) in the directory. I can't see the file inside the
database, but it exists in the file system.

I already tried this before  I'm working on a desktop machine and
after every reboot every processes will be closed. The effect is
always the same :(

Regards && tnx for answer :-]

Sebastian


On Tue, May 13, 2008 at 3:30 PM, Rick Hillegas <Ri...@sun.com> wrote:
> Thanks for the detailed explanation, Sebastian. Now I think I am tracking
> you.
>
>  The situation you describe sounds odd to me. If you bring down the VM which
> is running the database, does the orphaned copy of the jar file disappear
> from the subdirectory  under the database directory?
>
>  Thanks,
>
>
>  -Rick
>
>  Sebastian Pfaff wrote:
>
> > Hi Rick,
> >
> > tnx for your answer, i think you understood everything. I'm writing
> > this mail just to clarify things.
> >
> > My initial problem is: I installed a jar file (via install_jar
> > command). And i cannot remove it with remove_jar command. But the jar
> > file resides in the jar directory of the database. If i'm trying to
> > delete the jar file i get this error:
> >
> > ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
> >
> > So i wanted to know, if it's possible to delete the jar file manually
> > from file system. The thing i want to do is something like this:
> >
> > rm /home/me/DATACENTER/SM_DATA_LAYER/jar/APP/SAMPLE1.jar.G1210431624637
> >
> > But i'm not sure if this command will create inconsistencies within
> > the database and something gets broken inside the database.
> >
> > If i'm right informed every jar file which is installed inside the
> > database will be stored in the jar directory of the database (e.g.
> > My_databse/jar). If i'm wrong, please correct me.
> >
> > Regards
> >
> > Sebastian Pfaff
> >
> >
> >
> > On Tue, May 13, 2008 at 12:54 AM, Rick Hillegas
> > <Ri...@sun.com> wrote:
> >
> >
> > > Hi Sebastian,
> > >
> > >  I'm not sure I'm understanding your question. Please bear with me. The
> > > install_jar command copies the jar file from the file system into the
> > > database. The remove_jar command deletes the jar file from the database.
> > > Neither command alters the external file system. If you need to delete
> an
> > > obsolete jar file from the file system, you can use ordinary operating
> > > system commands.
> > >
> > >
> > >
> > >  Hope this helps,
> > >  -Rick
> > >
> > >  Sebastian Pfaff wrote:
> > >
> > >
> > >
> > > > Hi Rick,
> > > >
> > > > tnx for your answer! Your snippet works fine (if i install/include a
> > > > new jar file, your snippet shows me this). But when i have NO NEW
> > > > ADDTIONIAL jars in my database installed and if i'm executing your SQL
> > > > snippet:
> > > >
> > > > ij> SELECT s.schemaname, f.filename FROM sys.sysschemas s,
> > > > sys.sysfiles f WHERE s.schemaid = f.schemaid
> > > >
> > > > i get this result:
> > > >
> > > > SCHEMANAME
> > > >                                                        |FILENAME
> > > >
> > > >
> > > >
> > >
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > >
> > >
> > > > 0 rows selected
> > > >
> > > > the jar file ISN'T listed here (!!!), but the jar file
> > > > SAMPLE1.jar.G1210431624637  _IS_STILL_ in the filesystem:
> > > >
> > > > ls SM_DATA_LAYER/jar/APP/
> > > > SAMPLE1.jar.G1210431624637
> > > >
> > > > So i have only one question:
> > > >
> > > > How can i remove this jar file (Would it be save to remove the jar
> > > > file via a manual delete on the filesystem?)?
> > > >
> > > > Regards && tnx in advance
> > > >
> > > > Sebastian
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Mon, May 12, 2008 at 6:23 PM, Rick Hillegas
> <Ri...@sun.com>
> > > >
> > > >
> > > wrote:
> > >
> > >
> > > >
> > > >
> > > > > Hi Sebastian,
> > > > >
> > > > >  The following query will show you the names of the jar files loaded
> > > > >
> > > > >
> > > >
> > > into
> > >
> > >
> > > >
> > > > > your database:
> > > > >
> > > > >  select s.schemaname, f.filename
> > > > >  from sys.sysschemas s, sys.sysfiles f
> > > > >  where s.schemaid=f.schemaid
> > > > >
> > > > >  So, for instance, the following script runs like this for me:
> > > > >
> > > > >  ij> call sqlj.install_jar( '/Users/rhillegas/junk/z.txt',
> 'APP.Foo', 0
> > > > >
> > > > >
> > > >
> > > );
> > >
> > >
> > > >
> > > > >  0 rows inserted/updated/deleted
> > > > >  ij> select s.schemaname, f.filename
> > > > >  from sys.sysschemas s, sys.sysfiles f
> > > > >  where s.schemaid=f.schemaid
> > > > >  ;
> > > > >  SCHEMANAME
> > > > > |FILENAME
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > >
> > >
> > > >
> > > > >  APP
> > > > > |FOO
> > > > >
> > > > >  1 row selected
> > > > >  ij> call sqlj.remove_jar( 'APP.Foo', 0 );
> > > > >  0 rows inserted/updated/deleted
> > > > >  ij> select s.schemaname, f.filename
> > > > >  from sys.sysschemas s, sys.sysfiles f
> > > > >  where s.schemaid=f.schemaid
> > > > >  ;
> > > > >  SCHEMANAME
> > > > > |FILENAME
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > >
> > >
> > > >
> > > > >  0 rows selected
> > > > >
> > > > >  Hope this helps,
> > > > >  -Rick
> > > > >
> > > > >
> > > > >
> > > > >  Sebastian Pfaff wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Hello,
> > > > > >
> > > > > > how can i see which jars are included in my database? I want to
> see
> > > > > > all jars which are added through a call of 'CALL sqlj.install_jar
> > > > > > [...]'.
> > > > > >
> > > > > > the main problem is:
> > > > > >
> > > > > > yesterday i added a jar to my database via the call of:
> > > > > >
> > > > > > ij> CALL
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> sqlj.install_jar('/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > > 'APP.Sample1', 0);
> > > > > >
> > > > > > Notice: [...]Pojects[...] is a typo but that is ok!!!
> > > > > >
> > > > > > You can see the jar in the filesystem:
> > > > > >
> > > > > > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > > > > > SAMPLE1.jar.G1210431624637
> > > > > >
> > > > > > today i tried to remove the jar via a call of:
> > > > > >
> > > > > > ij> CALL sqlj.remove_jar('APP.Sample1', 0);
> > > > > >
> > > > > > The call above always produces this errror:
> > > > > >
> > > > > > ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
> > > > > >
> > > > > > here the server side stacktrace:
> > > > > >
> > > > > > 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
> > > > > > 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
> > > > > > NF000001.DF1C-1025975079512780256{2}), Cleanup action starting
> > > > > > 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
> > > > > > 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
> > > > > > NF000001.DF1C-1025975079512780256{2}), Failed Statement is: CALL
> > > > > > sqlj.remove_jar('APP.Sample1', 0)
> > > > > > ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > org.apache.derby.iapi.error.StandardException.newException(Unknown
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Source)
> > > > > >      at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown
> > > > > >
> > > > > >
> > > > >
> > > >
> > > Source)
> > >
> > >
> > > >
> > > > >
> > > > > >      at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown
> > > > > >
> > > > > >
> > > > >
> > > >
> > > Source)
> > >
> > >
> > > >
> > > > >
> > > > > >      at
> org.apache.derby.catalog.SystemProcedures.REMOVE_JAR(Unknown
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > Source)
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> org.apache.derby.exe.acf81e0010x0119xdd3bxc79bx00001d72cbbd1b.g0(Unknown
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Source)
> > > > > >      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > >      at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Source)
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Source)
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Source)
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Source)
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > > Source)
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown
> > >
> > >
> > > >
> > > > >
> > > > >
> > > > > > Source)
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Source)
> > > > > >      at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown
> > > > > >
> > > > > >
> > > > >
> > > >
> > > Source)
> > >
> > >
> > > >
> > > > >
> > > > > >      at
> > > > > >
> > > > > >
> > > > >
> > > >
> > > org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
> > >
> > >
> > > >
> > > > >
> > > > > > Source)
> > > > > >      at
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Source)
> > > > > >      at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown
> Source)
> > > > > > Cleanup action completed
> > > > > >
> > > > > > If i'm trying to include/install an additional jar file everything
> > > > > >
> > > > > >
> > > > >
> > > >
> > > works
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > >
> > > > > fine:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > ij> CALL sqlj.install_jar(
> > > > > >
> '/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
> > > > > > 'APP.Sample1', 0);
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > > Statement executed.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > here layout of filesystem before removing:
> > > > > >
> > > > > > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > > > > > SAMPLE1.jar.G1210431624637  SAMPLE1.jar.G1210597561003
> > > > > >
> > > > > > ij> CALL sqlj.remove_jar('APP.Sample1', 0);
> > > > > > Statement executed.
> > > > > > ij>
> > > > > >
> > > > > > layout just after removing:
> > > > > >
> > > > > > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > > > > > SAMPLE1.jar.G1210431624637
> > > > > >
> > > > > > It seems to be impossible to remove the file named
> > > > > > 'SAMPLE1.jar.G1210431624637'! It would be nice to know, how to
> make
> > > > > > included/installed jars visible and how to remove them if a call
> of
> > > > > > sqlj.remove_jar fails.
> > > > > >
> > > > > > Is it save to remove the file manually from filesystem (e.g. rm
> > > > > > SAMPLE1.jar.G1210431624637)?
> > > > > >
> > > > > > my environment is:
> > > > > >
> > > > > > Linux 2.6.25.1 && java version "1.6.0_06 && derby 10.4
> > > > > >
> > > > > >
> > > > > > If you need additional infos, please let me know. Any help is
> > > > > >
> > > > > >
> > > > >
> > > >
> > > appreciated.
> > >
> > >
> > > >
> > > > >
> > > > > > TNX in advance!
> > > > > >
> > > > > > Sebastian
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

Re: can't remove jar file from database (ERROR X0X13)!!!

Posted by Rick Hillegas <Ri...@Sun.COM>.
Thanks for the detailed explanation, Sebastian. Now I think I am 
tracking you.

The situation you describe sounds odd to me. If you bring down the VM 
which is running the database, does the orphaned copy of the jar file 
disappear from the subdirectory  under the database directory?

Thanks,
-Rick

Sebastian Pfaff wrote:
> Hi Rick,
>
> tnx for your answer, i think you understood everything. I'm writing
> this mail just to clarify things.
>
> My initial problem is: I installed a jar file (via install_jar
> command). And i cannot remove it with remove_jar command. But the jar
> file resides in the jar directory of the database. If i'm trying to
> delete the jar file i get this error:
>
> ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
>
> So i wanted to know, if it's possible to delete the jar file manually
> from file system. The thing i want to do is something like this:
>
> rm /home/me/DATACENTER/SM_DATA_LAYER/jar/APP/SAMPLE1.jar.G1210431624637
>
> But i'm not sure if this command will create inconsistencies within
> the database and something gets broken inside the database.
>
> If i'm right informed every jar file which is installed inside the
> database will be stored in the jar directory of the database (e.g.
> My_databse/jar). If i'm wrong, please correct me.
>
> Regards
>
> Sebastian Pfaff
>
>
>
> On Tue, May 13, 2008 at 12:54 AM, Rick Hillegas
> <Ri...@sun.com> wrote:
>   
>> Hi Sebastian,
>>
>>  I'm not sure I'm understanding your question. Please bear with me. The
>> install_jar command copies the jar file from the file system into the
>> database. The remove_jar command deletes the jar file from the database.
>> Neither command alters the external file system. If you need to delete an
>> obsolete jar file from the file system, you can use ordinary operating
>> system commands.
>>
>>
>>
>>  Hope this helps,
>>  -Rick
>>
>>  Sebastian Pfaff wrote:
>>
>>     
>>> Hi Rick,
>>>
>>> tnx for your answer! Your snippet works fine (if i install/include a
>>> new jar file, your snippet shows me this). But when i have NO NEW
>>> ADDTIONIAL jars in my database installed and if i'm executing your SQL
>>> snippet:
>>>
>>> ij> SELECT s.schemaname, f.filename FROM sys.sysschemas s,
>>> sys.sysfiles f WHERE s.schemaid = f.schemaid
>>>
>>> i get this result:
>>>
>>> SCHEMANAME
>>>                                                         |FILENAME
>>>
>>>       
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>     
>>> 0 rows selected
>>>
>>> the jar file ISN'T listed here (!!!), but the jar file
>>> SAMPLE1.jar.G1210431624637  _IS_STILL_ in the filesystem:
>>>
>>> ls SM_DATA_LAYER/jar/APP/
>>> SAMPLE1.jar.G1210431624637
>>>
>>> So i have only one question:
>>>
>>> How can i remove this jar file (Would it be save to remove the jar
>>> file via a manual delete on the filesystem?)?
>>>
>>> Regards && tnx in advance
>>>
>>> Sebastian
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Mon, May 12, 2008 at 6:23 PM, Rick Hillegas <Ri...@sun.com>
>>>       
>> wrote:
>>     
>>>       
>>>> Hi Sebastian,
>>>>
>>>>  The following query will show you the names of the jar files loaded
>>>>         
>> into
>>     
>>>> your database:
>>>>
>>>>  select s.schemaname, f.filename
>>>>  from sys.sysschemas s, sys.sysfiles f
>>>>  where s.schemaid=f.schemaid
>>>>
>>>>  So, for instance, the following script runs like this for me:
>>>>
>>>>  ij> call sqlj.install_jar( '/Users/rhillegas/junk/z.txt', 'APP.Foo', 0
>>>>         
>> );
>>     
>>>>  0 rows inserted/updated/deleted
>>>>  ij> select s.schemaname, f.filename
>>>>  from sys.sysschemas s, sys.sysfiles f
>>>>  where s.schemaid=f.schemaid
>>>>  ;
>>>>  SCHEMANAME
>>>> |FILENAME
>>>>
>>>>
>>>>         
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>     
>>>>  APP
>>>> |FOO
>>>>
>>>>  1 row selected
>>>>  ij> call sqlj.remove_jar( 'APP.Foo', 0 );
>>>>  0 rows inserted/updated/deleted
>>>>  ij> select s.schemaname, f.filename
>>>>  from sys.sysschemas s, sys.sysfiles f
>>>>  where s.schemaid=f.schemaid
>>>>  ;
>>>>  SCHEMANAME
>>>> |FILENAME
>>>>
>>>>
>>>>         
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>     
>>>>  0 rows selected
>>>>
>>>>  Hope this helps,
>>>>  -Rick
>>>>
>>>>
>>>>
>>>>  Sebastian Pfaff wrote:
>>>>
>>>>
>>>>
>>>>         
>>>>> Hello,
>>>>>
>>>>> how can i see which jars are included in my database? I want to see
>>>>> all jars which are added through a call of 'CALL sqlj.install_jar
>>>>> [...]'.
>>>>>
>>>>> the main problem is:
>>>>>
>>>>> yesterday i added a jar to my database via the call of:
>>>>>
>>>>> ij> CALL
>>>>>
>>>>>
>>>>>           
>> sqlj.install_jar('/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
>>     
>>>>         
>>>>> 'APP.Sample1', 0);
>>>>>
>>>>> Notice: [...]Pojects[...] is a typo but that is ok!!!
>>>>>
>>>>> You can see the jar in the filesystem:
>>>>>
>>>>> ls DATACENTER/SM_DATA_LAYER/jar/APP/
>>>>> SAMPLE1.jar.G1210431624637
>>>>>
>>>>> today i tried to remove the jar via a call of:
>>>>>
>>>>> ij> CALL sqlj.remove_jar('APP.Sample1', 0);
>>>>>
>>>>> The call above always produces this errror:
>>>>>
>>>>> ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
>>>>>
>>>>> here the server side stacktrace:
>>>>>
>>>>> 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
>>>>> 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
>>>>> NF000001.DF1C-1025975079512780256{2}), Cleanup action starting
>>>>> 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
>>>>> 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
>>>>> NF000001.DF1C-1025975079512780256{2}), Failed Statement is: CALL
>>>>> sqlj.remove_jar('APP.Sample1', 0)
>>>>> ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
>>>>>       at
>>>>>
>>>>>
>>>>>           
>>>> org.apache.derby.iapi.error.StandardException.newException(Unknown
>>>>
>>>>
>>>>         
>>>>> Source)
>>>>>       at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown
>>>>>           
>> Source)
>>     
>>>>>       at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown
>>>>>           
>> Source)
>>     
>>>>>       at org.apache.derby.catalog.SystemProcedures.REMOVE_JAR(Unknown
>>>>>
>>>>>
>>>>>           
>>>> Source)
>>>>
>>>>
>>>>         
>>>>>       at
>>>>>
>>>>>
>>>>>           
>>>> org.apache.derby.exe.acf81e0010x0119xdd3bxc79bx00001d72cbbd1b.g0(Unknown
>>>>
>>>>
>>>>         
>>>>> Source)
>>>>>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>       at
>>>>>
>>>>>
>>>>>           
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>     
>>>>         
>>>>>       at
>>>>>
>>>>>
>>>>>           
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>     
>>>>         
>>>>>       at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>       at
>>>>>
>>>>>
>>>>>           
>>>> org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown
>>>>
>>>>
>>>>         
>>>>> Source)
>>>>>       at
>>>>>
>>>>>
>>>>>           
>>>> org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown
>>>>
>>>>
>>>>         
>>>>> Source)
>>>>>       at
>>>>>
>>>>>
>>>>>           
>>>> org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
>>>>
>>>>
>>>>         
>>>>> Source)
>>>>>       at
>>>>>
>>>>>
>>>>>           
>>>> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
>>>>
>>>>
>>>>         
>>>>> Source)
>>>>>       at
>>>>>
>>>>>
>>>>>           
>> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
>>     
>>>>         
>>>>> Source)
>>>>>       at
>>>>>
>>>>>
>>>>>           
>> org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown
>>     
>>>>         
>>>>> Source)
>>>>>       at
>>>>>
>>>>>
>>>>>           
>>>> org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
>>>>
>>>>
>>>>         
>>>>> Source)
>>>>>       at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown
>>>>>           
>> Source)
>>     
>>>>>       at
>>>>>           
>> org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
>>     
>>>>> Source)
>>>>>       at
>>>>>
>>>>>
>>>>>           
>>>> org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
>>>>
>>>>
>>>>         
>>>>> Source)
>>>>>       at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
>>>>> Cleanup action completed
>>>>>
>>>>> If i'm trying to include/install an additional jar file everything
>>>>>           
>> works
>>     
>>>>>           
>>>> fine:
>>>>
>>>>
>>>>         
>>>>> ij> CALL sqlj.install_jar(
>>>>>   '/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
>>>>> 'APP.Sample1', 0);
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>           
>>>>>> Statement executed.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>> here layout of filesystem before removing:
>>>>>
>>>>> ls DATACENTER/SM_DATA_LAYER/jar/APP/
>>>>> SAMPLE1.jar.G1210431624637  SAMPLE1.jar.G1210597561003
>>>>>
>>>>> ij> CALL sqlj.remove_jar('APP.Sample1', 0);
>>>>> Statement executed.
>>>>> ij>
>>>>>
>>>>> layout just after removing:
>>>>>
>>>>> ls DATACENTER/SM_DATA_LAYER/jar/APP/
>>>>> SAMPLE1.jar.G1210431624637
>>>>>
>>>>> It seems to be impossible to remove the file named
>>>>> 'SAMPLE1.jar.G1210431624637'! It would be nice to know, how to make
>>>>> included/installed jars visible and how to remove them if a call of
>>>>> sqlj.remove_jar fails.
>>>>>
>>>>> Is it save to remove the file manually from filesystem (e.g. rm
>>>>> SAMPLE1.jar.G1210431624637)?
>>>>>
>>>>> my environment is:
>>>>>
>>>>> Linux 2.6.25.1 && java version "1.6.0_06 && derby 10.4
>>>>>
>>>>>
>>>>> If you need additional infos, please let me know. Any help is
>>>>>           
>> appreciated.
>>     
>>>>> TNX in advance!
>>>>>
>>>>> Sebastian
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>           
>>>>         
>>     


Re: can't remove jar file from database (ERROR X0X13)!!!

Posted by Sebastian Pfaff <se...@gmail.com>.
Hi Rick,

tnx for your answer, i think you understood everything. I'm writing
this mail just to clarify things.

My initial problem is: I installed a jar file (via install_jar
command). And i cannot remove it with remove_jar command. But the jar
file resides in the jar directory of the database. If i'm trying to
delete the jar file i get this error:

ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.

So i wanted to know, if it's possible to delete the jar file manually
from file system. The thing i want to do is something like this:

rm /home/me/DATACENTER/SM_DATA_LAYER/jar/APP/SAMPLE1.jar.G1210431624637

But i'm not sure if this command will create inconsistencies within
the database and something gets broken inside the database.

If i'm right informed every jar file which is installed inside the
database will be stored in the jar directory of the database (e.g.
My_databse/jar). If i'm wrong, please correct me.

Regards

Sebastian Pfaff



On Tue, May 13, 2008 at 12:54 AM, Rick Hillegas
<Ri...@sun.com> wrote:
> Hi Sebastian,
>
>  I'm not sure I'm understanding your question. Please bear with me. The
> install_jar command copies the jar file from the file system into the
> database. The remove_jar command deletes the jar file from the database.
> Neither command alters the external file system. If you need to delete an
> obsolete jar file from the file system, you can use ordinary operating
> system commands.
>
>
>
>  Hope this helps,
>  -Rick
>
>  Sebastian Pfaff wrote:
>
> > Hi Rick,
> >
> > tnx for your answer! Your snippet works fine (if i install/include a
> > new jar file, your snippet shows me this). But when i have NO NEW
> > ADDTIONIAL jars in my database installed and if i'm executing your SQL
> > snippet:
> >
> > ij> SELECT s.schemaname, f.filename FROM sys.sysschemas s,
> > sys.sysfiles f WHERE s.schemaid = f.schemaid
> >
> > i get this result:
> >
> > SCHEMANAME
> >                                                         |FILENAME
> >
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> >
> > 0 rows selected
> >
> > the jar file ISN'T listed here (!!!), but the jar file
> > SAMPLE1.jar.G1210431624637  _IS_STILL_ in the filesystem:
> >
> > ls SM_DATA_LAYER/jar/APP/
> > SAMPLE1.jar.G1210431624637
> >
> > So i have only one question:
> >
> > How can i remove this jar file (Would it be save to remove the jar
> > file via a manual delete on the filesystem?)?
> >
> > Regards && tnx in advance
> >
> > Sebastian
> >
> >
> >
> >
> >
> >
> > On Mon, May 12, 2008 at 6:23 PM, Rick Hillegas <Ri...@sun.com>
> wrote:
> >
> >
> > > Hi Sebastian,
> > >
> > >  The following query will show you the names of the jar files loaded
> into
> > > your database:
> > >
> > >  select s.schemaname, f.filename
> > >  from sys.sysschemas s, sys.sysfiles f
> > >  where s.schemaid=f.schemaid
> > >
> > >  So, for instance, the following script runs like this for me:
> > >
> > >  ij> call sqlj.install_jar( '/Users/rhillegas/junk/z.txt', 'APP.Foo', 0
> );
> > >  0 rows inserted/updated/deleted
> > >  ij> select s.schemaname, f.filename
> > >  from sys.sysschemas s, sys.sysfiles f
> > >  where s.schemaid=f.schemaid
> > >  ;
> > >  SCHEMANAME
> > > |FILENAME
> > >
> > >
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > >  APP
> > > |FOO
> > >
> > >  1 row selected
> > >  ij> call sqlj.remove_jar( 'APP.Foo', 0 );
> > >  0 rows inserted/updated/deleted
> > >  ij> select s.schemaname, f.filename
> > >  from sys.sysschemas s, sys.sysfiles f
> > >  where s.schemaid=f.schemaid
> > >  ;
> > >  SCHEMANAME
> > > |FILENAME
> > >
> > >
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > >
> > >  0 rows selected
> > >
> > >  Hope this helps,
> > >  -Rick
> > >
> > >
> > >
> > >  Sebastian Pfaff wrote:
> > >
> > >
> > >
> > > > Hello,
> > > >
> > > > how can i see which jars are included in my database? I want to see
> > > > all jars which are added through a call of 'CALL sqlj.install_jar
> > > > [...]'.
> > > >
> > > > the main problem is:
> > > >
> > > > yesterday i added a jar to my database via the call of:
> > > >
> > > > ij> CALL
> > > >
> > > >
> > >
> sqlj.install_jar('/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
> > >
> > >
> > > > 'APP.Sample1', 0);
> > > >
> > > > Notice: [...]Pojects[...] is a typo but that is ok!!!
> > > >
> > > > You can see the jar in the filesystem:
> > > >
> > > > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > > > SAMPLE1.jar.G1210431624637
> > > >
> > > > today i tried to remove the jar via a call of:
> > > >
> > > > ij> CALL sqlj.remove_jar('APP.Sample1', 0);
> > > >
> > > > The call above always produces this errror:
> > > >
> > > > ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
> > > >
> > > > here the server side stacktrace:
> > > >
> > > > 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
> > > > 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
> > > > NF000001.DF1C-1025975079512780256{2}), Cleanup action starting
> > > > 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
> > > > 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
> > > > NF000001.DF1C-1025975079512780256{2}), Failed Statement is: CALL
> > > > sqlj.remove_jar('APP.Sample1', 0)
> > > > ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
> > > >       at
> > > >
> > > >
> > > org.apache.derby.iapi.error.StandardException.newException(Unknown
> > >
> > >
> > > > Source)
> > > >       at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown
> Source)
> > > >       at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown
> Source)
> > > >       at org.apache.derby.catalog.SystemProcedures.REMOVE_JAR(Unknown
> > > >
> > > >
> > > Source)
> > >
> > >
> > > >       at
> > > >
> > > >
> > > org.apache.derby.exe.acf81e0010x0119xdd3bxc79bx00001d72cbbd1b.g0(Unknown
> > >
> > >
> > > > Source)
> > > >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >       at
> > > >
> > > >
> > >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > >
> > >
> > > >       at
> > > >
> > > >
> > >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > >
> > >
> > > >       at java.lang.reflect.Method.invoke(Method.java:597)
> > > >       at
> > > >
> > > >
> > > org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown
> > >
> > >
> > > > Source)
> > > >       at
> > > >
> > > >
> > > org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown
> > >
> > >
> > > > Source)
> > > >       at
> > > >
> > > >
> > > org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
> > >
> > >
> > > > Source)
> > > >       at
> > > >
> > > >
> > > org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
> > >
> > >
> > > > Source)
> > > >       at
> > > >
> > > >
> > >
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
> > >
> > >
> > > > Source)
> > > >       at
> > > >
> > > >
> > >
> org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown
> > >
> > >
> > > > Source)
> > > >       at
> > > >
> > > >
> > > org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
> > >
> > >
> > > > Source)
> > > >       at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown
> Source)
> > > >       at
> org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
> > > > Source)
> > > >       at
> > > >
> > > >
> > > org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
> > >
> > >
> > > > Source)
> > > >       at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
> > > > Cleanup action completed
> > > >
> > > > If i'm trying to include/install an additional jar file everything
> works
> > > >
> > > >
> > > fine:
> > >
> > >
> > > > ij> CALL sqlj.install_jar(
> > > >   '/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
> > > > 'APP.Sample1', 0);
> > > >
> > > >
> > > >
> > > >
> > > > > Statement executed.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > here layout of filesystem before removing:
> > > >
> > > > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > > > SAMPLE1.jar.G1210431624637  SAMPLE1.jar.G1210597561003
> > > >
> > > > ij> CALL sqlj.remove_jar('APP.Sample1', 0);
> > > > Statement executed.
> > > > ij>
> > > >
> > > > layout just after removing:
> > > >
> > > > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > > > SAMPLE1.jar.G1210431624637
> > > >
> > > > It seems to be impossible to remove the file named
> > > > 'SAMPLE1.jar.G1210431624637'! It would be nice to know, how to make
> > > > included/installed jars visible and how to remove them if a call of
> > > > sqlj.remove_jar fails.
> > > >
> > > > Is it save to remove the file manually from filesystem (e.g. rm
> > > > SAMPLE1.jar.G1210431624637)?
> > > >
> > > > my environment is:
> > > >
> > > > Linux 2.6.25.1 && java version "1.6.0_06 && derby 10.4
> > > >
> > > >
> > > > If you need additional infos, please let me know. Any help is
> appreciated.
> > > >
> > > > TNX in advance!
> > > >
> > > > Sebastian
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
>
>

Re: can't remove jar file from database (ERROR X0X13)!!!

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi Sebastian,

I'm not sure I'm understanding your question. Please bear with me. The 
install_jar command copies the jar file from the file system into the 
database. The remove_jar command deletes the jar file from the database. 
Neither command alters the external file system. If you need to delete 
an obsolete jar file from the file system, you can use ordinary 
operating system commands.

Hope this helps,
-Rick

Sebastian Pfaff wrote:
> Hi Rick,
>
> tnx for your answer! Your snippet works fine (if i install/include a
> new jar file, your snippet shows me this). But when i have NO NEW
> ADDTIONIAL jars in my database installed and if i'm executing your SQL
> snippet:
>
> ij> SELECT s.schemaname, f.filename FROM sys.sysschemas s,
> sys.sysfiles f WHERE s.schemaid = f.schemaid
>
> i get this result:
>
> SCHEMANAME
>                                                          |FILENAME
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> 0 rows selected
>
> the jar file ISN'T listed here (!!!), but the jar file
> SAMPLE1.jar.G1210431624637  _IS_STILL_ in the filesystem:
>
> ls SM_DATA_LAYER/jar/APP/
> SAMPLE1.jar.G1210431624637
>
> So i have only one question:
>
> How can i remove this jar file (Would it be save to remove the jar
> file via a manual delete on the filesystem?)?
>
> Regards && tnx in advance
>
> Sebastian
>
>
>
>
>
>
> On Mon, May 12, 2008 at 6:23 PM, Rick Hillegas <Ri...@sun.com> wrote:
>   
>> Hi Sebastian,
>>
>>  The following query will show you the names of the jar files loaded into
>> your database:
>>
>>  select s.schemaname, f.filename
>>  from sys.sysschemas s, sys.sysfiles f
>>  where s.schemaid=f.schemaid
>>
>>  So, for instance, the following script runs like this for me:
>>
>>  ij> call sqlj.install_jar( '/Users/rhillegas/junk/z.txt', 'APP.Foo', 0 );
>>  0 rows inserted/updated/deleted
>>  ij> select s.schemaname, f.filename
>>  from sys.sysschemas s, sys.sysfiles f
>>  where s.schemaid=f.schemaid
>>  ;
>>  SCHEMANAME
>> |FILENAME
>>
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>  APP
>> |FOO
>>
>>  1 row selected
>>  ij> call sqlj.remove_jar( 'APP.Foo', 0 );
>>  0 rows inserted/updated/deleted
>>  ij> select s.schemaname, f.filename
>>  from sys.sysschemas s, sys.sysfiles f
>>  where s.schemaid=f.schemaid
>>  ;
>>  SCHEMANAME
>> |FILENAME
>>
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>
>>  0 rows selected
>>
>>  Hope this helps,
>>  -Rick
>>
>>
>>
>>  Sebastian Pfaff wrote:
>>
>>     
>>> Hello,
>>>
>>> how can i see which jars are included in my database? I want to see
>>> all jars which are added through a call of 'CALL sqlj.install_jar
>>> [...]'.
>>>
>>> the main problem is:
>>>
>>> yesterday i added a jar to my database via the call of:
>>>
>>> ij> CALL
>>>       
>> sqlj.install_jar('/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
>>     
>>> 'APP.Sample1', 0);
>>>
>>> Notice: [...]Pojects[...] is a typo but that is ok!!!
>>>
>>> You can see the jar in the filesystem:
>>>
>>> ls DATACENTER/SM_DATA_LAYER/jar/APP/
>>> SAMPLE1.jar.G1210431624637
>>>
>>> today i tried to remove the jar via a call of:
>>>
>>> ij> CALL sqlj.remove_jar('APP.Sample1', 0);
>>>
>>> The call above always produces this errror:
>>>
>>> ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
>>>
>>> here the server side stacktrace:
>>>
>>> 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
>>> 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
>>> NF000001.DF1C-1025975079512780256{2}), Cleanup action starting
>>> 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
>>> 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
>>> NF000001.DF1C-1025975079512780256{2}), Failed Statement is: CALL
>>> sqlj.remove_jar('APP.Sample1', 0)
>>> ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
>>>        at
>>>       
>> org.apache.derby.iapi.error.StandardException.newException(Unknown
>>     
>>> Source)
>>>        at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown Source)
>>>        at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown Source)
>>>        at org.apache.derby.catalog.SystemProcedures.REMOVE_JAR(Unknown
>>>       
>> Source)
>>     
>>>        at
>>>       
>> org.apache.derby.exe.acf81e0010x0119xdd3bxc79bx00001d72cbbd1b.g0(Unknown
>>     
>>> Source)
>>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>        at
>>>       
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>     
>>>        at
>>>       
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>     
>>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>>        at
>>>       
>> org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown
>>     
>>> Source)
>>>        at
>>>       
>> org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown
>>     
>>> Source)
>>>        at
>>>       
>> org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
>>     
>>> Source)
>>>        at
>>>       
>> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
>>     
>>> Source)
>>>        at
>>>       
>> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
>>     
>>> Source)
>>>        at
>>>       
>> org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown
>>     
>>> Source)
>>>        at
>>>       
>> org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
>>     
>>> Source)
>>>        at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown Source)
>>>        at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
>>> Source)
>>>        at
>>>       
>> org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
>>     
>>> Source)
>>>        at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
>>> Cleanup action completed
>>>
>>> If i'm trying to include/install an additional jar file everything works
>>>       
>> fine:
>>     
>>> ij> CALL sqlj.install_jar(
>>>    '/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
>>> 'APP.Sample1', 0);
>>>
>>>
>>>       
>>>> Statement executed.
>>>>
>>>>
>>>>         
>>> here layout of filesystem before removing:
>>>
>>> ls DATACENTER/SM_DATA_LAYER/jar/APP/
>>> SAMPLE1.jar.G1210431624637  SAMPLE1.jar.G1210597561003
>>>
>>> ij> CALL sqlj.remove_jar('APP.Sample1', 0);
>>> Statement executed.
>>> ij>
>>>
>>> layout just after removing:
>>>
>>> ls DATACENTER/SM_DATA_LAYER/jar/APP/
>>> SAMPLE1.jar.G1210431624637
>>>
>>> It seems to be impossible to remove the file named
>>> 'SAMPLE1.jar.G1210431624637'! It would be nice to know, how to make
>>> included/installed jars visible and how to remove them if a call of
>>> sqlj.remove_jar fails.
>>>
>>> Is it save to remove the file manually from filesystem (e.g. rm
>>> SAMPLE1.jar.G1210431624637)?
>>>
>>> my environment is:
>>>
>>> Linux 2.6.25.1 && java version "1.6.0_06 && derby 10.4
>>>
>>>
>>> If you need additional infos, please let me know. Any help is appreciated.
>>>
>>> TNX in advance!
>>>
>>> Sebastian
>>>
>>>
>>>       
>>     


Re: can't remove jar file from database (ERROR X0X13)!!!

Posted by Sebastian Pfaff <se...@gmail.com>.
Hi Rick,

tnx for your answer! Your snippet works fine (if i install/include a
new jar file, your snippet shows me this). But when i have NO NEW
ADDTIONIAL jars in my database installed and if i'm executing your SQL
snippet:

ij> SELECT s.schemaname, f.filename FROM sys.sysschemas s,
sys.sysfiles f WHERE s.schemaid = f.schemaid

i get this result:

SCHEMANAME
                                                         |FILENAME
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

0 rows selected

the jar file ISN'T listed here (!!!), but the jar file
SAMPLE1.jar.G1210431624637  _IS_STILL_ in the filesystem:

ls SM_DATA_LAYER/jar/APP/
SAMPLE1.jar.G1210431624637

So i have only one question:

How can i remove this jar file (Would it be save to remove the jar
file via a manual delete on the filesystem?)?

Regards && tnx in advance

Sebastian






On Mon, May 12, 2008 at 6:23 PM, Rick Hillegas <Ri...@sun.com> wrote:
> Hi Sebastian,
>
>  The following query will show you the names of the jar files loaded into
> your database:
>
>  select s.schemaname, f.filename
>  from sys.sysschemas s, sys.sysfiles f
>  where s.schemaid=f.schemaid
>
>  So, for instance, the following script runs like this for me:
>
>  ij> call sqlj.install_jar( '/Users/rhillegas/junk/z.txt', 'APP.Foo', 0 );
>  0 rows inserted/updated/deleted
>  ij> select s.schemaname, f.filename
>  from sys.sysschemas s, sys.sysfiles f
>  where s.schemaid=f.schemaid
>  ;
>  SCHEMANAME
> |FILENAME
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>  APP
> |FOO
>
>  1 row selected
>  ij> call sqlj.remove_jar( 'APP.Foo', 0 );
>  0 rows inserted/updated/deleted
>  ij> select s.schemaname, f.filename
>  from sys.sysschemas s, sys.sysfiles f
>  where s.schemaid=f.schemaid
>  ;
>  SCHEMANAME
> |FILENAME
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>  0 rows selected
>
>  Hope this helps,
>  -Rick
>
>
>
>  Sebastian Pfaff wrote:
>
> > Hello,
> >
> > how can i see which jars are included in my database? I want to see
> > all jars which are added through a call of 'CALL sqlj.install_jar
> > [...]'.
> >
> > the main problem is:
> >
> > yesterday i added a jar to my database via the call of:
> >
> > ij> CALL
> sqlj.install_jar('/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
> > 'APP.Sample1', 0);
> >
> > Notice: [...]Pojects[...] is a typo but that is ok!!!
> >
> > You can see the jar in the filesystem:
> >
> > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > SAMPLE1.jar.G1210431624637
> >
> > today i tried to remove the jar via a call of:
> >
> > ij> CALL sqlj.remove_jar('APP.Sample1', 0);
> >
> > The call above always produces this errror:
> >
> > ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
> >
> > here the server side stacktrace:
> >
> > 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
> > 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
> > NF000001.DF1C-1025975079512780256{2}), Cleanup action starting
> > 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
> > 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
> > NF000001.DF1C-1025975079512780256{2}), Failed Statement is: CALL
> > sqlj.remove_jar('APP.Sample1', 0)
> > ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
> >        at
> org.apache.derby.iapi.error.StandardException.newException(Unknown
> > Source)
> >        at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown Source)
> >        at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown Source)
> >        at org.apache.derby.catalog.SystemProcedures.REMOVE_JAR(Unknown
> Source)
> >        at
> org.apache.derby.exe.acf81e0010x0119xdd3bxc79bx00001d72cbbd1b.g0(Unknown
> > Source)
> >        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >        at java.lang.reflect.Method.invoke(Method.java:597)
> >        at
> org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown
> > Source)
> >        at
> org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown
> > Source)
> >        at
> org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
> > Source)
> >        at
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
> > Source)
> >        at
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
> > Source)
> >        at
> org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown
> > Source)
> >        at
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
> > Source)
> >        at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown Source)
> >        at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
> > Source)
> >        at
> org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
> > Source)
> >        at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
> > Cleanup action completed
> >
> > If i'm trying to include/install an additional jar file everything works
> fine:
> >
> > ij> CALL sqlj.install_jar(
> >    '/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
> > 'APP.Sample1', 0);
> >
> >
> > > Statement executed.
> > >
> > >
> >
> > here layout of filesystem before removing:
> >
> > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > SAMPLE1.jar.G1210431624637  SAMPLE1.jar.G1210597561003
> >
> > ij> CALL sqlj.remove_jar('APP.Sample1', 0);
> > Statement executed.
> > ij>
> >
> > layout just after removing:
> >
> > ls DATACENTER/SM_DATA_LAYER/jar/APP/
> > SAMPLE1.jar.G1210431624637
> >
> > It seems to be impossible to remove the file named
> > 'SAMPLE1.jar.G1210431624637'! It would be nice to know, how to make
> > included/installed jars visible and how to remove them if a call of
> > sqlj.remove_jar fails.
> >
> > Is it save to remove the file manually from filesystem (e.g. rm
> > SAMPLE1.jar.G1210431624637)?
> >
> > my environment is:
> >
> > Linux 2.6.25.1 && java version "1.6.0_06 && derby 10.4
> >
> >
> > If you need additional infos, please let me know. Any help is appreciated.
> >
> > TNX in advance!
> >
> > Sebastian
> >
> >
>
>

Re: can't remove jar file from database (ERROR X0X13)!!!

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi Sebastian,

The following query will show you the names of the jar files loaded into 
your database:

select s.schemaname, f.filename
from sys.sysschemas s, sys.sysfiles f
where s.schemaid=f.schemaid

So, for instance, the following script runs like this for me:

ij> call sqlj.install_jar( '/Users/rhillegas/junk/z.txt', 'APP.Foo', 0 );
0 rows inserted/updated/deleted
ij> select s.schemaname, f.filename
from sys.sysschemas s, sys.sysfiles f
where s.schemaid=f.schemaid
;
SCHEMANAME                                                                                                                      
|FILENAME                                                                                                                        

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
APP                                                                                                                             
|FOO                                                                                                                             


1 row selected
ij> call sqlj.remove_jar( 'APP.Foo', 0 );
0 rows inserted/updated/deleted
ij> select s.schemaname, f.filename
from sys.sysschemas s, sys.sysfiles f
where s.schemaid=f.schemaid
;
SCHEMANAME                                                                                                                      
|FILENAME                                                                                                                        

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

0 rows selected

Hope this helps,
-Rick

Sebastian Pfaff wrote:
> Hello,
>
> how can i see which jars are included in my database? I want to see
> all jars which are added through a call of 'CALL sqlj.install_jar
> [...]'.
>
> the main problem is:
>
> yesterday i added a jar to my database via the call of:
>
> ij> CALL sqlj.install_jar('/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
> 'APP.Sample1', 0);
>
> Notice: [...]Pojects[...] is a typo but that is ok!!!
>
> You can see the jar in the filesystem:
>
> ls DATACENTER/SM_DATA_LAYER/jar/APP/
> SAMPLE1.jar.G1210431624637
>
> today i tried to remove the jar via a call of:
>
> ij> CALL sqlj.remove_jar('APP.Sample1', 0);
>
> The call above always produces this errror:
>
> ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
>
> here the server side stacktrace:
>
> 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
> 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
> NF000001.DF1C-1025975079512780256{2}), Cleanup action starting
> 2008-05-12 14:44:51.422 GMT Thread[DRDAConnThread_3,5,main] (XID =
> 13623), (SESSIONID = 0), (DATABASE = SM_DATA_LAYER), (DRDAID =
> NF000001.DF1C-1025975079512780256{2}), Failed Statement is: CALL
> sqlj.remove_jar('APP.Sample1', 0)
> ERROR X0X13: Jar file 'SAMPLE1' does not exist in schema 'APP'.
>         at org.apache.derby.iapi.error.StandardException.newException(Unknown
> Source)
>         at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown Source)
>         at org.apache.derby.impl.sql.execute.JarUtil.drop(Unknown Source)
>         at org.apache.derby.catalog.SystemProcedures.REMOVE_JAR(Unknown Source)
>         at org.apache.derby.exe.acf81e0010x0119xdd3bxc79bx00001d72cbbd1b.g0(Unknown
> Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown
> Source)
>         at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown
> Source)
>         at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
> Source)
>         at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
> Source)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
> Source)
>         at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown
> Source)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
> Source)
>         at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
> Cleanup action completed
>
> If i'm trying to include/install an additional jar file everything works fine:
>
> ij> CALL sqlj.install_jar(
>     '/me/netBeansPojects/java/DerbyZeroCheck/dist/DatabaseRoutines.jar',
> 'APP.Sample1', 0);
>   
>> Statement executed.
>>     
>
> here layout of filesystem before removing:
>
> ls DATACENTER/SM_DATA_LAYER/jar/APP/
> SAMPLE1.jar.G1210431624637  SAMPLE1.jar.G1210597561003
>
> ij> CALL sqlj.remove_jar('APP.Sample1', 0);
> Statement executed.
> ij>
>
> layout just after removing:
>
> ls DATACENTER/SM_DATA_LAYER/jar/APP/
> SAMPLE1.jar.G1210431624637
>
> It seems to be impossible to remove the file named
> 'SAMPLE1.jar.G1210431624637'! It would be nice to know, how to make
> included/installed jars visible and how to remove them if a call of
> sqlj.remove_jar fails.
>
> Is it save to remove the file manually from filesystem (e.g. rm
> SAMPLE1.jar.G1210431624637)?
>
> my environment is:
>
> Linux 2.6.25.1 && java version "1.6.0_06 && derby 10.4
>
>
> If you need additional infos, please let me know. Any help is appreciated.
>
> TNX in advance!
>
> Sebastian
>