From derby-user-return-9237-apmail-db-derby-user-archive=db.apache.org@db.apache.org Tue May 13 16:42:08 2008 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 91339 invoked from network); 13 May 2008 16:42:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 May 2008 16:42:08 -0000 Received: (qmail 58851 invoked by uid 500); 13 May 2008 16:42:08 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 58821 invoked by uid 500); 13 May 2008 16:42:08 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 58810 invoked by uid 99); 13 May 2008 16:42:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 May 2008 09:42:08 -0700 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.43.133] (HELO sca-es-mail-2.sun.com) (192.18.43.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 May 2008 16:41:13 +0000 Received: from fe-sfbay-10.sun.com ([192.18.43.129]) by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m4DGfXWP001348 for ; Tue, 13 May 2008 09:41:33 -0700 (PDT) Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K0T00K01F6CX500@fe-sfbay-10.sun.com> (original mail from Richard.Hillegas@Sun.COM) for derby-user@db.apache.org; Tue, 13 May 2008 09:41:33 -0700 (PDT) Received: from richard-hillegas-computer.local ([129.150.17.142]) by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K0T00FMJFP7MW80@fe-sfbay-10.sun.com> for derby-user@db.apache.org; Tue, 13 May 2008 09:41:32 -0700 (PDT) Date: Tue, 13 May 2008 09:41:31 -0700 From: Rick Hillegas Subject: Re: can't remove jar file from database (ERROR X0X13)!!! In-reply-to: <9e7fde520805130935x28a5901ex40ce56bd9b45adbd@mail.gmail.com> Sender: Richard.Hillegas@Sun.COM To: Derby Discussion Message-id: <4829C4BB.3050903@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <9e7fde520805120808p5bd52e9ag3830ae68d1a7a27d@mail.gmail.com> <48286F13.7050906@sun.com> <9e7fde520805121346r5037e41cj213f78386b4f69cb@mail.gmail.com> <4828CAA5.1050702@sun.com> <9e7fde520805130159y3ba9d26ald29ca4c15e864db0@mail.gmail.com> <482997D8.6080409@sun.com> <9e7fde520805130935x28a5901ex40ce56bd9b45adbd@mail.gmail.com> User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) X-Virus-Checked: Checked by ClamAV on apache.org 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 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 >>> 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 >>>>> >> >> >>>>> >>>> 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 >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>> >>