<?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>Adam Jordens@littlesquare:~/ &#187; Database</title>
	<atom:link href="http://littlesquare.com/category/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://littlesquare.com</link>
	<description>Just a little square in a sea of blogs.</description>
	<lastBuildDate>Sun, 27 Jun 2010 04:32:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Testing with Unitils</title>
		<link>http://littlesquare.com/2008/08/testing-with-unitils/</link>
		<comments>http://littlesquare.com/2008/08/testing-with-unitils/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 17:49:36 +0000</pubDate>
		<dc:creator>ajordens</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[General Discussions]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://littlesquare.com/2008/08/30/testing-with-unitils/</guid>
		<description><![CDATA[I was doing some reading and came across Unitils (1.1 was just released). Unitils is an open source library aimed at making unit testing easy and maintainable. Unitils builds further on existing libraries like DBUnit and EasyMock and integrates with JUnit and TestNG . Unitils provides general asserion utilities, support for database testing, support for [...]]]></description>
			<content:encoded><![CDATA[<p>I was doing some reading and came across <a href="http://www.unitils.org">Unitils</a> (1.1 was just <a href="http://www.theserverside.com/news/thread.tss?thread_id=50487">released</a>).</p>
<blockquote>
<p>Unitils is an open source library aimed at making unit testing easy and maintainable. Unitils builds further on existing libraries like DBUnit and EasyMock and integrates with JUnit and TestNG .</p>
<p>Unitils provides general asserion utilities, support for database testing, support for testing with mock objects and offers integration with Spring , Hibernate and the Java Persistence API (JPA). It has been designed to offer these services to unit tests in a very configurable and loosely coupled way. As a result, services can be added and extended very easily.</p>
</blockquote>
<p>What particularly caught my attention was the support they&#8217;ve included for <em>transactional</em> test cases. By transactional, I mean test cases that will automatically cleanup after themselves. Simply include a @Transactional and you&#8217;re rocking.</p>
<p>In the past, we&#8217;ve rolled this capability ourselves with varying degrees of success. It&#8217;s easy to support rolling back of inserts but somewhat difficult to handle rolling back of deletes and other data mutations.</p>
<p>I&#8217;m just in the process of kicking off some new product development (<em>actually, we&#8217;re one week into it but who&#8217;s counting</em>) and general infrastructure (<em>testing included</em>) is something forefront on our minds.</p>
<p>For starters, we&#8217;ve got <em>Cobertura</em> and <em>Selenium</em> integrated into our build. General unit is covered with <em>TestNG</em> with Seam components integration tested using <em>SeamTest/Embedded JBoss</em>. Everything short of the <em>Selenium</em> tests are hitting freshly initialized in-memory databases.</p>
<p>It might be worth considering something like Unitils at this stage rather than building out our own tooling to accomplish much the same thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://littlesquare.com/2008/08/testing-with-unitils/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If All Else Fails&#8230; try Oracle Text</title>
		<link>http://littlesquare.com/2006/10/if-all-else-fails-try-oracle-text/</link>
		<comments>http://littlesquare.com/2006/10/if-all-else-fails-try-oracle-text/#comments</comments>
		<pubDate>Thu, 05 Oct 2006 05:47:49 +0000</pubDate>
		<dc:creator>ajordens</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://www.jordens.org/?p=196</guid>
		<description><![CDATA[The last week or so I&#8217;ve spent doing some performance optimizations on our application in preparation for a data-intensive demo. Everything was going well, caught some of the low hanging fruit (running things on the EDT, not batching requests, retrieving too much data, etc) but ran into a brick wall when trying to do a [...]]]></description>
			<content:encoded><![CDATA[<p>The last week or so I&#8217;ve spent doing some performance optimizations on our application in preparation for a data-intensive demo.</p>
<p>Everything was going well, caught some of the low hanging fruit (running things on the EDT, not batching requests, retrieving too much data, etc) but ran into a brick wall when trying to do a contains (%VALUE%) query on a table with 100k records joined to a table with 75million records.</p>
<p>ie)  SELECT tableA.* from TableA tableA join TableB tableB on tableA.fk = tableB.pk WHERE tableB.sequence LIKE &#8216;%VALUE%&#8217;;</p>
<p>The explain plan (the DB in this instance was Oracle) didn&#8217;t look bad when doing the query on TableB, but when joining to TableA it absolutely blew up.</p>
<p>To cut to the chase here, I ended up creating a contextual index on the column using the <a href="http://www.oracle.com/technology/oramag/oracle/04-sep/o54text.html">Oracle Text</a> package that was installed along with the DB. The explain plan complexity droped like a stone and things were good again.</p>
<p>In the end, a rather simple solution to a problem that was quite significant in our books. I don&#8217;t know enough about the Oracle Text package to say whether its a good thing or not.  We&#8217;re doing context-based searches on long strings of characters, not the documents for which it appears to have been defined.  Already I&#8217;ve found that a search for 3 characters takes magnitudes amount of time longer than a search for 4 characters (although this makes sense).</p>
<p>What I didn&#8217;t try was creating a straight index on the column but from people I talked to and what I read that wouldn&#8217;t have helped in the case of the %%.  We had another case where an UPPER() function call was causing it to miss an index, but I believe in that case I should be able to create a index on the UPPER&#8217;d result or perhaps another column in the table and a trigger that always UPPER()&#8217;s the result in it.</p>
<p>Back to my regularly scheduled life as a developer, too much DB work for one day.</p>
]]></content:encoded>
			<wfw:commentRss>http://littlesquare.com/2006/10/if-all-else-fails-try-oracle-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
