<?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>f3yourmind &#187; Hibernate</title>
	<atom:link href="http://aslamkhan.net/tag/hibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://aslamkhan.net</link>
	<description>Ubuntu coding ... for your friends</description>
	<lastBuildDate>Mon, 24 Oct 2011 07:07:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The optimistic concurrency gotcha</title>
		<link>http://aslamkhan.net/software-development/the-optimistic-concurrency-gotcha/</link>
		<comments>http://aslamkhan.net/software-development/the-optimistic-concurrency-gotcha/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 00:43:38 +0000</pubDate>
		<dc:creator>Aslam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://aslamkhan.net/software-development/the-optimistic-concurrency-gotcha/</guid>
		<description><![CDATA[In my current project, I have a group of about 7 budding young developers none of whom have done any significant web development.  This includes hitching up to a database and using object relational mappers.  The one thing that always gets first-timers is stateless nature of the web.  And the first solution they come up [...]]]></description>
			<content:encoded><![CDATA[<p>In my current project, I have a group of about 7 budding young developers none of whom have done any significant web development.  This includes hitching up to a database and using object relational mappers.  The one thing that always gets first-timers is stateless nature of the web.  And the first solution they come up with is session based statefulness which eventually leads to a scalability bottleneck.  The ripple effect of lack of state is that you need to have optimistic concurrency at the data access level.  Now most of us just assume that our OR Mapper will solve that for us.  And, yes, they do offer optimistic concurrency out of the box, be it with a version column or without.  But <a href="http://www.matshelander.com">Mats Helander</a> makes a strong point that optimistic concurrency in most (maybe all) OR Mappers actually kicks for really short durations (milliseconds).  In that case, you might as well be using good old fashioned database transactions.  Mats suggests that a way to solve the problem is to store original values in the view.  Check out Mats&#8217; <a href="http://www.matshelander.com/wordpress/?p=65">post</a> and you&#8217;ll see why you should be storing, at the very least, your <a href="http://www.hibernate.org">Hibernate</a> version column/property on your view as well.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Faslamkhan.net%2Fsoftware-development%2Fthe-optimistic-concurrency-gotcha%2F&amp;title=The%20optimistic%20concurrency%20gotcha" id="wpa2a_2"><img src="http://aslamkhan.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://aslamkhan.net/software-development/the-optimistic-concurrency-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

