Is there a way to remove the .lock file programmatically?

I'm creating a web app with NetBeans, Tomcat and the H2 Database Engine and am having troubles with database errors that seem to be caused by the .lock file existing in the directory where I am storing the database.
Is there a way to programmatically remove the .lock file? I like for the database to be locked only when it is being accessed by either of two different servers, but so far am having trouble with only one server running.
I have tried calling the close() method from the class that calls my database class when it is done with it, but it is creating an exception stating that the database is already open and tells me to close it. That's what I was trying to do!
Edited by: GoDonkeys on Feb 9, 2010 4:39 PM

Saish wrote:
Are you closing it this way [http://hsqldb.org/doc/2.0/guide/running-chapt.html#running_closing-sect]? And why are you worried about this? If two servers are going to connect, you should be running in HSQL "server" mode [http://hsqldb.org/doc/2.0/guide/running-chapt.html#running_modes-sect]. You can erase the lock file using java.io.File. But IMO, the fact you want to do this indicates you are not using the right database mode.
- SaishI started out using HSQLDB, but it was giving me problems when I was trying to add data to my database, so I switched to H2 (as stated above) and it was able to add as much data as I could throw at it without any issues. My problem is that while debugging with NetBeans I occasionally get exceptions from H2 (through JDBC) that the database is locked and access was denied.
I would like to be able to only have the database "open" when I'm actively querying it or manipulating it.

Similar Messages

  • Is there any way to eliminate the locked file function in iWork apps?

    Hi, I recently added Lion to my Mac. Is there any way to eliminate the "locked file" function. I do not use iCloud or Time Machine on my Mac. Thanks. Bob

    I don't use Time Machine either but the option for this function is in the Time Machine options.
    Open System Preferences > Time Machine
    Click 'Options'
    The bottom option should be about auto-saving. To stop applications from locking documents, uncheck the box. To extend the peiod before the document is locked, select the appropriate time from the drop-down menu.
    Hope that;s what you wanted!

  • Is there a way to remove the white background from clip art

    Is there a way to remove the white background from clip art?

    And replace it with what? transparency? You'll need to work in a format that supports that like png or psd. So you'll need a good editor too.
    Regards
    TD

  • Is there any way to remove the duration from the course outline in Presenter 8?

    Is there any way to remove the duration from the course outline in Presenter 8? I would prefer to not have that listed if at all posible and can't find a solution.

    Are you talking about the Time Remaining display on the side bar? The text for that field is in the Modify Text Labels... tool in the Theme Editor of Presenter. You can change it to whatever you want, but you may want to keep a record of what the default text labels are, as there is no restore to default option. The Elapsed Time field is what you would want to change. I have seen this modified to show no text, copyright information or other general info.

  • I have a dvd stuck in the drive and as I can not boot is there a way of removing the dvd ?

    Hi
    I have a dvd stuck in the drive and as I can not boot is there a way of removing the dvd ?

    Boot with the option key down.  You will see a window showing all the bootable systems.  Select the OSX boot and hit return.  Once you are booted into OSX, use the Startup Disk system preferences to change your default boot volume.
    Startup Manager: How to select a startup volume

  • HT5891 Is there a way to remove the menu bar from a secondary display while still using the "Displays have separate spaces" mode?

    Is there a way to remove the menu bar from a secondary display while still using the very useful "Displays have separate spaces" mode?
    The reason I ask is that most full-screen video playback in most applications, from iTunes to Flash/Silverlight plugins do not take up the full screen, instead leaving space for the menu bar (in the case of iTunes) or leaving the menu bar present on top of the video (for fullscreen Flash/Silverlight videos).
    This is annoying for several reasons ranging from the obvious distraction factor to the fact that 1080p video is not played back at native resolution on a 1080p display.
    If there is no way to disable this functionality while maintaining separate spaces, I would (humbly) suggest that a future update to Mavericks allow non-Lion-style* full-screen apps to take over the entire display.
    *Lion-style full-screen apps are those that animate into a full-screen mode when the opposing-arrows full-screen button in the upper-right-hand corner of the window is pressed.

    No. Turning that off reverts to the old display setup. You have one desktop spanned across all displays. The menu bar appears on the primary display only.

  • Is there a way to remove the old apple id on 'new' refurbished ipad

    I purchased a refurbished ipad mini from the apple store. It came with someone else's AppleID on it, and I cannot get it to sign in on my AppleID. Is there a way to remove the old account and replace it with mine, or do I need to return this?

    merryberry83 wrote:
    I purchased a refurbished ipad mini from the apple store. It came with someone else's AppleID on it,
    Return it.

  • Is there a way to remove the pulldown tab?

    Is there a way to remove the pull down tab that shows weather, stocks, reminders and ect? It’s very annoying and even gets triggered while in other apps while unwanted. In fact its one of the worst ideas they have ever added to the ipod. If I wanted to see the weather and stocks I would use the apps that are not removable to view them, don’t need another tab for that. Ive looked in all the settings and don’t see anyway to fix or change it. Please advise.

    I dont belive so

  • Is there a way to remove the date and time from pictures?

    Is there a way to remove the date and time from phoos in iPhoto?

    Are you referring to the Date and Time some cameras put right on the image?  If so there is nothing really good in iPhoto to do this. You could try the Retouch tool and see how that looks but I think you will need something more precise and powerful, like the clone tool in Aperture.
    Also something like PhotoShop or GIMP - The GNU Image Manipulation Program (free) should do what you want also.
    If your asking about some other date post back.
    regards

  • Is there a way to remove the text that appears over dock icons when the cursor is over them?

    Is there any way to remove the text that appears over dock icons when you hover over them?  Or at least make it time out, or become more transparent?

    You can do that with the Menu Editor extension - https://addons.mozilla.org/firefox/addon/menu-editor/
    This extension has not been updated by its author in a couple of years, but another developer has updated it for Firefox 4, you can get the updated version from http://netticat.ath.cx/MyAddons/MyAddons.htm#3rdpartyaddons

  • I have files that freeze my programs whenever I try to open ANY file. Is there a way to find the exact files causing the crash?

    I have files that are freezing my programs (adobe; after effect and photoshop, as well as maxon cinema 4d). Whenever I try to import ANY file from within the program it doen't even let me select the file I need before freezing. I have moved all files off my desktop and into my dropbox, and it now allows me to import files/search for files on the desktop but NOT dropbox, once I go to dropbox it freezes again. I am assuming there are files within dropbox now that are crashing my programs. The problem is I have a lot of files in there and would like to remove the corrupt ones so that I can use my programs without freezing. Is there a way to find the exact files causing the crash?
    This has happened a couple of times and each time I have to move all my files off my desktop, so there must be a type of file doing this, I just don't know what files they are.
    Mac Book Pro 15" running OSX 10.9
    Processor  2.3 GHz Intel Core i7
    Memory  16 GB 1600 MHz DDR3
    Graphics  Intel Iris Pro 1024 MB
    ANY help would be greatly appreciated! It is making it really hard to get work done. THANKS!

    This error sounds to me like you have/had BootCamp Windows installed and then removed, posible ?
    If so (and even if not so), try restating your MBA while holding down the alt/option-key until you get to the Boot Selection Screen.
    Choose to boot OSX.
    Once in OSX go to System Preferences then Startup Volume and set your OSX to be the default.
    Hope it helps
    Stefan

  • Is there any way to embed the pdf file in the book created in iBooks Author to make it available to be downloaded or sent to email? So that the user can print it out.

    Is there any way to embed the pdf file in the book created in iBooks Author to make it available to be downloaded or sent to email?
    I'm making the book for children and there is one chapter providing coloring pages. So I wish to attach pdf files that allow users to download it at the end of chapter so that  they can print it out. Been searching through discussion, I've found some advice about taking screen snapshot page-by-page > then send the pics from photo album to email. However, I'm wondering if there's a way that make the process easier.

    Warehouse that PDF on your own server, then link to it from your book.
    Ken

  • I accidentally deleted my media files from iTunes and Trash when I was trying to move the files to an external hard drive. Is there a way to restore the media files from a Time Machine backup or from iTunes Match? What are the steps to do this?

    I accidentally deleted my media files from iTunes and Trash when I was trying to move the files to an external hard drive. Is there a way to restore the media files from a Time Machine backup or from iTunes Match? What are the steps to do this?

    If you have been backing up on Timemachine.
    All you need to do is enter time machine... Then the rest is obvious.
    Find the iTunes folder and hit 'Restor'.
    If not the only way to get all your iTunes music back is to enter iTunes Store.
    On the right hand side you should see 'Purchased'.
    Click 'purchased' and there you have it.

  • I have written a binary file with a specific header format in LABVIEW 8.6 and tried to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I have written a binary file with a specific header format in LABVIEW 8.6 and tried  to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I can think of two possible stumbling blocks:
    What are your 8.6 options for "byte order" and "prepend array or string size"?
    Overall, many file IO functions have changed with LabVIEW 8.0, so there might not be an exact 1:1 code conversion. You might need to make some modifications. For example, in 7.1, you should use "write file", the "binary file VIs" are special purpose (I16 or SGL). What is your data type?
    LabVIEW Champion . Do more with less code and in less time .

  • Is there any way to import the PST file to Thunderbird

    My boss used Outlook 2010 to store all his emails. Is there any way to import the PST file to Thunderbird so he can access them from a new computer?
    Thunderbird cannot be installed on the old computer and Outlook is not on the new computer. All information is saved in a PST file on our local backup.
    Alternatively, is there a way to convert to a file type that CAN be imported? This is a 5GB file. (I know, I KNOW, but I cannot convince him he doesn't need all of these emails.)

    Does he use an e-mail provider with sufficient mailbox space? In that case, you can move the e-mail back to the server and download it using Thunderbird.
    This only works when you configure the e-mail account with IMAP (not POP3).
    Hope this helps.

Maybe you are looking for

  • [SOLVED] Blank screen starting new Xorg (ATI)

    Yes, it's another blank screen problem with xorg.  Sorry.  After months of sticking with an older Xorg (due to problems with my ATI Radeon X1550 card and the new Xorg w/ dual head), I decided to make a jump and update to the latest Xorg and ati drive

  • SCSM 2012 - Problems running script in custom workflow

    Hi all, I'm trying to create a custom workflow in the Authoring Tool that will send an email when a ticket in certain queues is unassigned, but I only want this to run during business hours. I've created the PowerShell script, and it runs great on it

  • How to reset auto fill in Safari 5

    I have changed my emails and my mac still only gives me my old email as an option when auto filling, I think u call it auto fill, its when you type the first letter and it shows your options. How can i change it.

  • FF 4Beta seems to be continuously refreshing itself 2-5 times per second - how to stop this ?

    FF 4Beta seems to be continuously refreshing itself 2-5 times per second - how do I stop this from occurring.

  • Flash for 2.2

    Does anyone know what is going on with Flash support for 2.2?  When I try to download it on my MOTO Droid thru the Market it says it can't be found....