<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gamutron &#187; HSQLDB</title>
	<atom:link href="http://gamutron.com/tag/hsqldb/feed" rel="self" type="application/rss+xml" />
	<link>http://gamutron.com</link>
	<description>Life in colour and code</description>
	<lastBuildDate>Fri, 23 Feb 2018 20:22:54 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>Accessing a locked HSQLDB database file in read-only mode</title>
		<link>http://gamutron.com/101/</link>
		<comments>http://gamutron.com/101/#comments</comments>
		<pubDate>Thu, 15 Jan 2015 20:23:02 +0000</pubDate>
		<dc:creator><![CDATA[Thomas Peter Berntsen]]></dc:creator>
				<category><![CDATA[Atlassian]]></category>
		<category><![CDATA[Operations]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Bamboo]]></category>
		<category><![CDATA[Confluence]]></category>
		<category><![CDATA[Crowd]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[HSQLDB]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[JIRA]]></category>
		<category><![CDATA[Stash]]></category>

		<guid isPermaLink="false">/?p=101</guid>
		<description><![CDATA[Working a lot with the Atlassian tools (JIRA, Confluence, Crowd, Stash etc.), I often have to connect to the databases running behind them in order to perform various SQL queries on the data. In a couple of use cases, it&#8217;s very convenient just to use the standard embedded HSQL database (HSQLDB) instead of a standalone relational [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Working a lot with the Atlassian tools (JIRA, Confluence, Crowd, Stash etc.), I often have to connect to the databases running behind them in order to perform various SQL queries on the data.</p>
<p>In a couple of use cases, it&#8217;s very convenient just to use the standard embedded HSQL database (HSQLDB) instead of a standalone relational database management system. However, with HSQLDB running in embedded mode, a lock file is set on the database file to inhibit other JDBC connections from writing to the database, which is, of course, very sensible (wouldn&#8217;t want any inconsistent data, now would we).</p>
<pre>Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@d446e57c[file =/SOME_FOLDER/database.lck, exists=true, locked=false, valid=false, ]</pre>
<p>To remove the lock on the database file, we would have to stop the application altogether. However, in many cases I want to query the database in read-only mode <em>while the application is running</em>, and fortunately the HSQLDB JDBC driver <a href="http://hsqldb.org/doc/guide/dbproperties-chapt.html#dpc_db_props_url">provides a property</a> that can be set to provide lock-ignoring read-only access to the database file.</p>
<p>My database query tool of choice is the excellent Java-based tool called <a href="http://www.dbvis.com/">DbVisualizer</a>, and setting the property can be done very simply in the Driver Properties tab of the connection settings view, adding a parameter &#8220;readonly&#8221; with value &#8220;true&#8221;.</p>
<p><a href="http://gamutron.com/wp-content/uploads/2015/01/HSQLDB-readonly-property-in-DbVisualizer.png"><img class="aligncenter size-full wp-image-105" src="http://gamutron.com/wp-content/uploads/2015/01/HSQLDB-readonly-property-in-DbVisualizer.png" alt="HSQLDB readonly property in DbVisualizer" width="909" height="749" /></a>With that set, all that is left is rock and roll &#8211; SQL style! <img style="margin-left: 3px; margin-right: 3px; vertical-align: middle; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;" src="http://www.gamutron.com/wp-content/plugins/wp-emoji-one/icons/1F60E.png" alt="" width="16" height="16" /></p>
<hr />
<p><strong>Further reading</strong></p>
<p>Atlassian: <a href="https://confluence.atlassian.com/display/DOC/Connecting+to+HSQLDB+using+DBVisualizer+or+HSQL+database+manager">Connecting to HSQLDB using DBVisualizer or HSQL database manager</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gamutron.com/101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
