How to delete jdb files at runtime?

My problem description is, i have to do complete index will be performed by creating a new empty index and adding content data to that (working index). Searches will continue to use the old (active) index. Once the index process is complete, the working and active indexes are swapped and the working index can be removed in preparation for the next complete analysis.
How can i remove jdb files at runtime without using java.io.File. ? [ According to the ejb specs an ejb should not try to use java.io package to attempt to access a file ].
Thanks,
Katta.

Hi Charles ,
I have implemented as your suggested way. I removed the old JE Database once new index (separate JE Database) created using env.removeDatabase() method. It's deleted the databse but *.bdb files not deleted(How can i reclaim the disk space). The cleaner is not deleting the files. Is cleaner will work without closing Environment. Do I need to use any methods to delete *.bdb files?
JEConnection jeConnection = null;
Environment env=null;
try
jeConnection = getConnection(OldJEEnvHome);
env = jeConnection.getEnvironment();
Database index, blocks;
index = jeConnection.openDatabase("__index__", null);
blocks = jeConnection.openDatabase("__blocks__", null);
String dbName1 = index.getDatabaseName();
String dbName2 = blocks.getDatabaseName();
Directory indexDir = new JEDirectory(null, index, blocks);
if(index!=null)index.close();
if(blocks!=null)blocks.close();
env.removeDatabase(null, dbName1);
env.removeDatabase(null, dbName2);
} catch (Exception e)
{    // TODO: handle exception
e.printStackTrace();
}finally{
if(jeConnection!=null)
jeConnection.close();
env.cleanLog();
//env.close();
public JEConnection getConnection(String dbEnvHome)
throws NamingException, JEException
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
envConfig.setTransactional(true);
envConfig.setConfigParam("je.cleaner.expunge", "true");
InitialContext iniCtx = new InitialContext();
Context enc = (Context) iniCtx.lookup("java:comp/env");
Object ref = enc.lookup("ra/JEConnectionFactory");
JEConnectionFactory dcf = (JEConnectionFactory) ref;
JEConnection dc = dcf.getConnection(dbEnvHome, envConfig);
return dc;
Thanks,
Katta.

Similar Messages

  • How to delete the file with space in name

    Hi
    I want to delete the file "test ex.txt" file.
    i run the following command in command prompt.i can delete the file successfully.
    /bin/rm -f /mnt/"test ex.txt"
    I want to run the command from java.So i am using the following code
    String cmd = "/bin/rm -f /mnt/\"test ex.txt\"";
         Runtime rt = Runtime.getRuntime();
    process = rt.exec(cmd);
    The file was not deleted.
    How to delete the file with space in name?
    Help me

    Use the form of exec that takes an array of command + args.
    arr[0] = "/bin/rm"
    arr[1] = "-f"
    arr[2] = "/home/me/some directory with spaces";Or use ProcessBuilder, which is the preferred replacement for Runtime.exec, and which Runtime.exec calls.

  • Question:  why isn't how to delete a file available.

    How come you have to search for the information on how to delete a file from Adobe Reader.   This should be in the instructions on how to use with how to download.  Does anyone agree?

    If it is a system file and even if the file is corrupted, it cannot be deleted.
    Try reinstalling phone software using Nokia suite if the phone supports Nokia suite and an USB port.
    -------------------If this post helped you, click on accept as solution.------------------
    -----------------------------Appreciate by clicking on white star.----------------------------

  • Anyone knows how to delete a file from a directory?????

    hi there
    anyone has any idea on how to delete a file from a directory? delete(String filename)? thank you.

    Hi,
    Check this link.
    Gives you an example code to show how to delete a file.
    http://examples.oreilly.com/jenut/Delete.java
    Hope this helps.
    Roopasri Vittal
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • How to delete a file in Keynote Remote for iPhone4?

    Any one know how to delete a file in Keynote remote app for iPhone4? I uploaded a Keynote file from iDisk to my iphone and I can't delete the file. The file does not show up when I connect my phone to iTunes.
    I also cannot connect my Iphone to Keynote anymore because of this file.

    The file is actually in the Keynote app and not the Keynote remote app for iPhone.

  • How to delete recent file history in adobe reader in Mac PC ?

    How to delete recent file history in Adobe Reader in Mac PC ?
    In Adobe Reader - Edit - Preferences - select Documents in the left panel and change the "Documents in recently used list" to 0. Yes ! the file history is gone But when you set back the value, you will see the file history again. This is not the way to do...
    I have checked all the preference or setting. I couldn't found any clear recent file history in adobe reader.
    Please help ! Thanks !

    First off, you CANNOT set recent documents to zero. The absolute minimum it will accept is 1. And on my MacMini, (I just checked it to be 100% sure) I opened seven documents with Recent Docs set to 10 - they were ALL listed. I set it to 1 and all but the most recent cleared. I then closed Reader and reopened it. The list was 1 item. I reset Recent Docs to 10 and there was still only 1 item in the list.

  • How to delete a file by using batch file

    hi
    i tried for deleting a file from batch filr in Linux environment.
    it is working when i run batch file thruogh command line.
    but its not woking through program.
    i am sending tha code that i used in tha program.
    First i have to create the file and send the information to that file
    and the content from taht file after that i have to delete the file.
    For that i wrote code but the batch is not woking.
    Batch file
    @echo off
    rm filename
    Actual Program Code
    I used RunServer
    public class RunServer extends Object
    RunServer();
    String cmdServer = "test.bat";
    Runtime run = Runtime.getRuntime();
    Process p = null;
    try
    p = run.exec(cmdServer);
    catch(IOException e)
    System.out.println("Error:"+e);
    By using RandomAccessFile i am creating a file
    please help me
    Thankyou

    1) You can't execute a batch without having a shell.
    2) It's totally stupid to run a one-line batch file from system.exec.
    3) It's also totally stupid to delete a file using Runtime altogether.
    But there you go...

  • In adf,how to delete a file generated on server,when the webpage is closed

    Hi,
    I have an application consisting of 2 pages. in the 1st page i will give some input details and when i click on submit, some java code is getting executed in the back. That java code generates a csv file in the server location. after succesful execution of java code, i was redirected to 2nd page. In 2nd page, i am giving option to download and when the user clicked on download button and after the file is downloaded -- in the backend i am deleting the file from the server. Till this point everything is fine. But if the user didnt click on the Download button and instead if he closes the browser, the csv file gets remained on the server itself. This is the issue i am facing .. I am not able to get an idea in ADF Framework, how to delete a file when the browser is closed. Please help me out in this.
    Thanks in advance !!!

    ADF has nothing to do with tracking browser close buttons. What you can do is call a JS function and call the method which deletes the file from within the JS function. ADF has a component for calling java code from JS call.

  • How to delete archivelog file at standby database

    Hi All,
    I'm running Physical Standby Database on ASM. At standby database, I can see all logs using asmcmd:
    ASMCMD> ls
    thread_1_seq_14.330.625772527
    thread_1_seq_15.346.625772527
    thread_1_seq_16.329.625772527
    thread_1_seq_17.327.625772559
    thread_1_seq_18.324.625772599
    thread_1_seq_19.341.625772367
    thread_1_seq_2.325.625772329
    But when I run RMAN to delete all these archivelogs, its give me error:
    oradr:/u01/app/oracle$rman rcvcat rman/rman@rman target /
    Recovery Manager: Release 10.2.0.3.0 - Production on Thu Jun 28 13:50:41 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: AIXDB (DBID=2438430915, not open)
    connected to recovery catalog database
    RMAN> delete archivelog all;
    Starting implicit crosscheck backup at 28-JUN-07:01:50:56
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of delete command at 06/28/2007 13:50:56
    RMAN-12010: automatic channel allocation initialization failed
    RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
    RMAN> register database;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of register command at 06/28/2007 13:51:06
    RMAN-08040: full resync skipped, control file is not current or backup
    Even it is not registering it. So how to delete archivelog file at standby database.
    Thanks in Advance
    Rakesh

    This appears related to Bug 3298797 that was supposed to be fixed in 10.2.0.1. The workaround is to switch over to the standby, register the standby and then switch back.

  • How to run media file after Runtime.exc the real player?

    Hi
    How to run media file after Runtime.exc the real player application

    String command = "cmd /c start videotest.rm";
    Runtime.getRuntime().exec(command);

  • How to delete  Plugins files in Library

    Hello guys.
    I am using AU plugins called Aalto .I saved files.
    That makes Logic keep crashing.
    So I wanna deleted the files I saved.
    I try to find a folder to removed it but I cound not find it .And try reinstall plugins and loading again but still the files is there. I dont get it.
    Can somebody help that how to delete the file  " Test version recoding ,Welcome to Aalto."?
    Please help.
    Thanks.
    Luna
    CCCcan

    If the cache path is to this folder then go with purging or else stop bi service and delete

  • How to delete temp files in /u99/temp/obiee_tmp

    Hi All,
    We have 50gb on /u99 but it got filled suddenly 35gb. While checking I found that following files are created with 7.1 gb size.
    nQS_7676_24_20578926.TMP
    Can someone please help us how to delete these files.
    1. Will running purge_cache.sh scripts clears these files?
    2. Can we delete these files manually?
    We have Oracle Business Intelligence 10.1.3.4.1
    Thanks in advance.

    If the cache path is to this folder then go with purging or else stop bi service and delete

  • Very Urjent: How to delete temporary files on the server.

    EBS:
    We are facing a big issue with huge volume of temporary directory.We have created invoice program which uses Bursting concept. Every concurrent program is erroring out. How to delete those files automarically.
    Where these temp files are getting stored. How can we delete them once the concurrent request is completed.
    Please help me..its a huge issue. Thanks in advance.

    Sorry Steven,
    I saw your solution. Thanks for that. But I just want to know, do we have any setups in XML Publisher Administrator or bursting control file to delete the files automatically once the concurrent request is completed.
    And one more thing I found is, In the xml administrator, General properties i have specified the temporary directory as '/tmp'. But all the temporary files are loading in '$XDO_TOP/temp' directory. Why is this..

  • How to delete temporary files on IPAD2?and is it possible or required!

    Dear all ,how to delete temporary files on iPad2

    Other than the browser items that King Penguin has described for you, there are no temporary files that are stored on the iPad. The iPad iOS does not work the same that a computer's OS works. There is nothing to delete.

  • How to delete locked files on flashdrive

    how to delete locked files on flashdrive

    1. Unlock them. http://support.apple.com/kb/ts1402
    or
    2. Format the drive.

Maybe you are looking for