<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>a lost tale @ Openbravo</title>
	<atom:link href="http://alostale.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://alostale.wordpress.com</link>
	<description>Just another Openbravo worker's blog</description>
	<lastBuildDate>Wed, 21 Oct 2009 16:00:41 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='alostale.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/f82f7bb2766a5ee0f84f2a8cc25049ad?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>a lost tale @ Openbravo</title>
		<link>http://alostale.wordpress.com</link>
	</image>
			<item>
		<title>Verifying WAD windows before generating them (II)</title>
		<link>http://alostale.wordpress.com/2009/10/20/verifying-wad-windows-before-generating-them-ii/</link>
		<comments>http://alostale.wordpress.com/2009/10/20/verifying-wad-windows-before-generating-them-ii/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 14:56:57 +0000</pubDate>
		<dc:creator>alostale</dc:creator>
				<category><![CDATA[Openbravo]]></category>
		<category><![CDATA[build process]]></category>

		<guid isPermaLink="false">http://alostale.wordpress.com/?p=153</guid>
		<description><![CDATA[As explained in my previous post, a new verification has been added before compiling WAD windows to detect possible errors.
The problem has appeared with the &#8220;Identifier verification&#8221; which forces all the tables used in the tabs to be generated to have at least one column set as identifier. This is strictly mandatory just in case [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=153&subd=alostale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As explained in my previous <a href="http://alostale.wordpress.com/2009/10/16/verifying-wad-windows-before-generating-them/">post</a>, a new verification has been added before compiling WAD windows to detect possible errors.</p>
<p>The problem has appeared with the &#8220;Identifier verification&#8221; which forces all the tables used in the tabs to be generated to have at least one column set as identifier. This is strictly mandatory just in case the table is a part of a foreign key, but as now modules expose all their tables as part of their public API, we decided to force all tables to have identifier. But as before it did compile, it is possible there were modules with tables without identifier.</p>
<p>To solve this problem, now the verification does not stop the compilation process in case errors are found, but it is highly recommendable to fix them in your modules as soon as you see them to prevent possible incompatibilities with other modules. In a future core release, this check by default will stop the process, in case it is not successful.</p>
Posted in Openbravo Tagged: build process <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alostale.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alostale.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alostale.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alostale.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alostale.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alostale.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alostale.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alostale.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alostale.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alostale.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=153&subd=alostale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alostale.wordpress.com/2009/10/20/verifying-wad-windows-before-generating-them-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">alostale</media:title>
		</media:content>
	</item>
		<item>
		<title>Verifying WAD windows before generating them</title>
		<link>http://alostale.wordpress.com/2009/10/16/verifying-wad-windows-before-generating-them/</link>
		<comments>http://alostale.wordpress.com/2009/10/16/verifying-wad-windows-before-generating-them/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 14:07:14 +0000</pubDate>
		<dc:creator>alostale</dc:creator>
				<category><![CDATA[Openbravo]]></category>
		<category><![CDATA[build process]]></category>

		<guid isPermaLink="false">http://alostale.wordpress.com/?p=147</guid>
		<description><![CDATA[Although developing automatic windows in Openbravo ERP is quite straight forward and saves a lot of coding time, in case something goes wrong it can be difficult to find out where the problem is. Of course you have the compilation log, but this is not always as user friendly as it should be. In many [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=147&subd=alostale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Although developing automatic windows in Openbravo ERP is quite straight forward and saves a lot of coding time, in case something goes wrong it can be difficult to find out where the problem is. Of course you have the compilation log, but this is not always as user friendly as it should be. In many occasions, it is quite hard to figure out the root cause for the error. It must be inferred from a ton of lines of log and some times it fails in a place that it is not expected, for example a missing identifier for a table can cause a SQL error.</p>
<p>Currently we are working on improving the build process, and one of the improvements we are putting in place (it is already pushed to pi) is a verifier that is run before generating WAD windows, this verifier will check a number of common mistakes that make the tabs not to be properly generated and will display a clear message about this stopping the process.</p>
<p>The idea is to gradually include new checks to this verifier, now we just look for tables without identifier and for tables without primary key. Any feedback on which checks would be useful is welcome.</p>
<p>I hope this makes life a little bit easier to Openbravo ERP developers.</p>
Posted in Openbravo Tagged: build process <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alostale.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alostale.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alostale.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alostale.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alostale.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alostale.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alostale.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alostale.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alostale.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alostale.wordpress.com/147/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=147&subd=alostale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alostale.wordpress.com/2009/10/16/verifying-wad-windows-before-generating-them/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">alostale</media:title>
		</media:content>
	</item>
		<item>
		<title>Single Record UI pattern</title>
		<link>http://alostale.wordpress.com/2009/07/07/single-record-ui-pattern/</link>
		<comments>http://alostale.wordpress.com/2009/07/07/single-record-ui-pattern/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 08:57:12 +0000</pubDate>
		<dc:creator>alostale</dc:creator>
				<category><![CDATA[Openbravo]]></category>
		<category><![CDATA[developers utilities]]></category>
		<category><![CDATA[r2.50]]></category>

		<guid isPermaLink="false">http://alostale.wordpress.com/?p=141</guid>
		<description><![CDATA[Single record UI pattern has been recently added to Openbravo ERP r2.50 development branch (pi). This new pattern allows to define a tab as update only not allowing new record insertions nor deletions. This is useful for some special tabs that show information which the user can edit but not modify or create new records, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=141&subd=alostale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><em>Single record UI pattern </em>has been recently added to Openbravo ERP r2.50 development branch (pi). This new pattern allows to define a tab as <em>update only</em> not allowing new record insertions nor deletions. This is useful for some special tabs that show information which the user can edit but not modify or create new records, usually the number of record is fixed or it is created by a process but not directly in the tab. An example for this is the <em>System Information </em>tab, which shows global information for the system, therefore it makes sense to change some of its values but never to create a new record; a different case where this pattern is now used is in the <em>Business Partner &gt; Customer </em>sub tab, when the Business Partner is a customer this tab contains the information related to this customer, records in this tab shouldn&#8217;t be directly created because they must be created in the parent one.</p>
<p>To implement this pattern a new concept has been added to the <em>tab </em>definition: <em>UI Pattern</em>. Each tab has a single UI pattern that can be selected among the values in a new drop down list.</p>
<p>Currently there are three patterns:</p>
<ul>
<li><em>Standard. </em>It is the usual representation that allows creating, modifying and deleting records.</li>
<li><em>Read Only. </em>It only allows to view the information but not to modify it. This pattern is not new in Openbravo ERP, but it has changed the way to define it. Previously there was a boolean value that set the tab to be read only, now that field has been deprecated and it is defined as a pattern in a new drop down list of values.</li>
<li><em>Single Record.</em>Which is the one described in this post.</li>
</ul>
<p><strong>Update: </strong>This feature will be included within Openbravo ERP 2.50 MP3</p>
Posted in Openbravo Tagged: developers utilities, r2.50 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alostale.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alostale.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alostale.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alostale.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alostale.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alostale.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alostale.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alostale.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alostale.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alostale.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=141&subd=alostale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alostale.wordpress.com/2009/07/07/single-record-ui-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">alostale</media:title>
		</media:content>
	</item>
		<item>
		<title>New document: database model</title>
		<link>http://alostale.wordpress.com/2009/04/06/new-document-database-model/</link>
		<comments>http://alostale.wordpress.com/2009/04/06/new-document-database-model/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 10:01:29 +0000</pubDate>
		<dc:creator>alostale</dc:creator>
				<category><![CDATA[Openbravo]]></category>
		<category><![CDATA[developers utilities]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[r2.50]]></category>

		<guid isPermaLink="false">http://alostale.wordpress.com/?p=136</guid>
		<description><![CDATA[Currently we are working on the Developers Guide for Openbravo ERP r2.50. Within these efforts, last week we have published the database model documentation. This documentation is automatically generated from the application&#8217;s on line help, and consists in the description for all tables in database and their columns. It is structured in Database_Model/Package/Table, so each [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=136&subd=alostale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Currently we are working on the <a href="http://wiki.openbravo.com/wiki/ERP/2.50/Developers_Guide">Developers Guide</a> for Openbravo ERP r2.50. Within these efforts, last week we have published the <a href="http://wiki.openbravo.com/wiki/ERP/2.50/Developers_Guide/Database_Model">database model documentation</a>. This documentation is automatically generated from the application&#8217;s on line help, and consists in the description for all tables in database and their columns. It is structured in Database_Model/Package/Table, so each table is included in its package chapter, the information for the columns in the table is included as sections in the table&#8217;s page.</p>
<p>The aim for all this, is not to have a readable document from head to bottom but to have a easily maintainable reference to be linked from any other document in the wiki, our goal is also to improve on line help and thus, enhance in parallel this document.</p>
<p>If you have any comment on this document: what you like/dislike, what would you include or improve, etc. please let me know and we&#8217;ll try to add this feedback.</p>
<p><strong>EDITED on 4-7: </strong>This document replaces the <a href="http://sourceforge.net/project/downloading.php?group_id=162271&amp;use_mirror=freefr&amp;filename=Openbravo_ER_2.40.pdf.zip&amp;a=48669647">Openbravo ERP ER</a> published for previous releases.</p>
Posted in Openbravo Tagged: developers utilities, documentation, r2.50 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alostale.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alostale.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alostale.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alostale.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alostale.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alostale.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alostale.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alostale.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alostale.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alostale.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=136&subd=alostale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alostale.wordpress.com/2009/04/06/new-document-database-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">alostale</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Mercurial&#8217;s bisect extension to find bugs</title>
		<link>http://alostale.wordpress.com/2009/03/02/using-mercurials-bisect-extension-to-find-bugs/</link>
		<comments>http://alostale.wordpress.com/2009/03/02/using-mercurials-bisect-extension-to-find-bugs/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 17:11:16 +0000</pubDate>
		<dc:creator>alostale</dc:creator>
				<category><![CDATA[Openbravo]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[scm]]></category>

		<guid isPermaLink="false">http://alostale.wordpress.com/?p=108</guid>
		<description><![CDATA[One week ago Openbravo ERP code was moved from Subversion to Mercurial. I am completely new to Mercurial and to distributed SCMs since I always worked with Subversion but, apart from the new concepts it incorporates, the transition was very smooth, at least till the moment. I&#8217;ve spent some time during the last days looking [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=108&subd=alostale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One week ago Openbravo ERP code was <a href="http://jpabloae.wordpress.com/2009/02/21/mercurial-coming-soon/">moved</a> from Subversion to Mercurial. I am completely new to Mercurial and to distributed SCMs since I always worked with Subversion but, apart from the new concepts it incorporates, the transition was very smooth, at least till the moment. I&#8217;ve spent some time during the last days looking the <a href="http://www.selenic.com/mercurial/wiki/index.cgi/UsingExtensions">extensions</a> Mercurial has and, for me, one of the nicest ones is <a href="http://www.selenic.com/mercurial/wiki/index.cgi/BisectExtension"><strong>bisect</strong></a>. Bisect can be very useful to find the changeset when a bug was introduced in the code.</p>
<h2>A real example</h2>
<p>Recently I was assigned this <a href="https://issues.openbravo.com/view.php?id=7718">bug</a>. I discovered that it was not present in  r2.40 but it was in development branch, furthermore, I find out the bug was caused because a line had been removed from the code. At this point I wanted to know which commit removed that line, just to know if it was a mistake or it was done on purpose trying to fix another bug, so the tedious work started: given two revisions one that has the bug (head of development branch) and another one that has not it (r2.40 tag) try different revisions in between to find which one removed the line that causes the bug. This is not only tedious but also very time consuming.</p>
<h2>A good solution: bisect</h2>
<p>Bisect is an extension for Mercurial that makes this kind of work much faster. Bisect&#8217;s behavior is pretty simple, you tell it the good and bad changesets and it updates your working copy to another one between them, then you can test if in that one the bug is present and you mark it as good or bad, then the process is run again until it finds the changeset that introduces the bug.  In fact bisect just decides for you which is the next changeset to test in. It sounds not to be a very high improvement, but if you combine it with some simple (at least in some occasions) automated test the results can be awesome.</p>
<p>Let me explain it through a simple example:</p>
<ul>
<li>First prepare the environment: a file with a lot of lines, and a commit somewhere there removing a line which we&#8217;ll look for afterwards.</li>
</ul>
<pre style="padding-left:30px;">$ hg init testBisect
$ cd testFile
$ cat testFile
This is
a file
with some feature
and this
line here
is needed to work fine</pre>
<pre style="padding-left:30px;">$ hg ci -A -m "init file"
adding testFile</pre>
<pre style="padding-left:30px;">$   for (( i = 0; i &amp;lt; 335; i++ )); do echo "line"$i &gt;&gt; testFile; hg commit -m "change here"; done</pre>
<pre style="padding-left:30px;">$ sed -i 's/line here//' testFile</pre>
<pre style="padding-left:30px;">$ hg ci -m "this commit is buggy"</pre>
<pre style="padding-left:30px;">$ for (( i = 0; i &amp;lt; 872; i++ )); do      echo "line"$i &gt;&gt; testFile;      hg commit -m "change here";      done</pre>
<pre style="padding-left:30px;">$ hg parents</pre>
<pre style="padding-left:30px;">changeset:   1208:7568a581b554
tag:         tip
user:        Asier Lostalé
date:        Mon Mar 02 11:13:39 2009 +0100
summary:     change here</pre>
<ul>
<li>Now we have 1208 changests! Let&#8217;s make the script to decide whether a revision is buggy or not and to continue looking in case it is not:</li>
</ul>
<pre style="padding-left:30px;">$  cat test1.sh</pre>
<pre style="padding-left:30px;">#!/bin/sh</pre>
<pre style="padding-left:30px;">MIN_ARGS=2
if [ $# -lt $MIN_ARGS ]; then
  echo "Usage: $(basename $0) FILE TEXT_TO_FIND" &gt;&amp;2
  exit 1
fi</pre>
<pre style="padding-left:30px;">FILE=$1
shift
TEXT_TO_FIND=$*</pre>
<pre style="padding-left:30px;">check() {
   grep -q "$TEXT_TO_FIND" $FILE &amp;&amp; RESULT=good || RESULT=bad
   echo $RESULT

   hg bisect --$RESULT
}</pre>
<pre style="padding-left:30px;">while :
do
  if check | grep -q 'Testing changeset'
then
  echo
  hg bisect
else
  hg bisect
  exit 0
fi
done</pre>
<ul>
<li>Now we are ready to start testing, first of all reset bisect and tell it which is the bad and good known revisions. Bad is current one and good is the first one.</li>
</ul>
<pre style="padding-left:30px;">$ hg bisect --reset
$ hg bisect --bad
$ hg bisect --good 1
Testing changeset 604:9d6a42635e81 (1207 changesets remaining, ~10 tests)
1 files updated, 0 files merged, 0 files removed, 0 files unresolved</pre>
<ul>
<li>Finally just execute the test to find out who removed the line.</li>
</ul>
<pre style="padding-left:30px;">$ time ./test1.sh testFile 'line here'
Testing changeset 302:132a5339324e (603 changesets remaining, ~9 tests)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved</pre>
<pre style="padding-left:30px;">Testing changeset 453:aa92eb899545 (302 changesets remaining, ~8 tests)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved</pre>
<pre style="padding-left:30px;">Testing changeset 377:5c8e69bdb1ce (151 changesets remaining, ~7 tests)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved</pre>
<pre style="padding-left:30px;">Testing changeset 339:05f7bb18e505 (75 changesets remaining, ~6 tests)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved</pre>
<pre style="padding-left:30px;">Testing changeset 320:3107aee2dbd2 (37 changesets remaining, ~5 tests)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved</pre>
<pre style="padding-left:30px;">Testing changeset 329:0d907ee53cdb (19 changesets remaining, ~4 tests)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved</pre>
<pre style="padding-left:30px;">Testing changeset 334:8a0d38375333 (10 changesets remaining, ~3 tests)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

Testing changeset 336:dc2037e24dfc (5 changesets remaining, ~2 tests)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved</pre>
<pre style="padding-left:30px;">Testing changeset 335:939ca611ae0f (2 changesets remaining, ~1 tests)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
The first bad revision is:
changeset:   336:dc2037e24dfc
user:        Asier Lostalé
date:        Mon Mar 02 11:11:52 2009 +0100
summary:     this commit is buggy</pre>
<pre style="padding-left:30px;">real    0m1.374s
user    0m1.128s
sys    0m0.204s</pre>
<p>And we are done: in less than 1.5s we know which is the commit that removed the line!</p>
<p>Though this example is quite theoretical I think bisect is a very good solution for this kind of searches. Do you have experience with this extension? Any comment about it is welcome.</p>
Posted in Openbravo Tagged: mercurial, scm <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alostale.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alostale.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alostale.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alostale.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alostale.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alostale.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alostale.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alostale.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alostale.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alostale.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=108&subd=alostale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alostale.wordpress.com/2009/03/02/using-mercurials-bisect-extension-to-find-bugs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">alostale</media:title>
		</media:content>
	</item>
		<item>
		<title>New build process: keep it simple</title>
		<link>http://alostale.wordpress.com/2009/02/09/new-build-process-keep-it-simple/</link>
		<comments>http://alostale.wordpress.com/2009/02/09/new-build-process-keep-it-simple/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 11:47:34 +0000</pubDate>
		<dc:creator>alostale</dc:creator>
				<category><![CDATA[Openbravo]]></category>
		<category><![CDATA[developers utilities]]></category>
		<category><![CDATA[r2.50]]></category>

		<guid isPermaLink="false">http://alostale.wordpress.com/?p=95</guid>
		<description><![CDATA[(Old) Problems
For Openbravo ERP developers (specially for newcomers) it has always been difficult to decide which of the available build tasks was the best election to build the system after any development they had done. We had to take into account what modifications were done to know which ant task we should run. For example [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=95&subd=alostale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h2>(Old) Problems</h2>
<p>For Openbravo ERP developers (specially for newcomers) it has always been difficult to decide which of the available build tasks was the best election to build the system after any development they had done. We had to take into account what modifications were done to know which ant task we should run. For example if we had modified a window we would use <em>ant compile -Dtab=myWindow </em>to generate the code just for that window and not for the rest of them.  It was even worse when working with subversion, each time we updated our working copy we had to look which were the files that had been updated to know if it was necessary to run <em>update.database </em>to synchronize Openbravo model database(database schema  objects and applicatoin dictionary data) from XML files. And in case there were modifications there it was worth re-generate all the WAD windows because it was difficult to know which ones had been modified. So many times <em>compile.complete</em> was the &#8220;safe&#8221; but slow choice.</p>
<p><em>Upadate.database</em> task had two more inconvenients: the first one was that in case Openbravo model was modified locally and not exported (<em>ant export.database</em>), when executing this task we would lose all the changes done in database for application dictionary. This annoying behavior had been reported as a <a href="https://issues.openbravo.com/view.php?id=6788">bug</a>. The other inconvenient was that during the r2.50 development cycle, specially because of the usage of <a href="http://wiki.openbravo.com/wiki/Projects/Data_Access_Layer">DAL</a> as part of the update process, this task was pretty unstable, making people not to be very confident about using it. As result people felt safer by recreating the whole system  (<em>ant install.source</em>) instead of executing a much faster incremental build (<em>ant update.database compile.complete</em>).</p>
<h2>New task: smartbuild</h2>
<p>For Openbravo ERP r2.50 we have resolved these problems by simplifying the <a href="http://wiki.openbravo.com/wiki/ERP/2.50/Development_tasks">build process</a> with a new incremental build task: <em>smartbuild, </em>which is currently available in trunk (r12753) and will be release in the next alpha (aplha r11)<em>.</em> This task performs all the required processes to build your  system but only the required ones, with a huge improvement in performance. It checks whether the database needs to be updated from xml sources and performs the update only if needed, generates the code that needs to be regenerated, compiles and deploys it.</p>
<p>The goal of this<em> smartbuild </em>is to replace most of the rest of tasks, making life a little simpler for developers. So now it is only needed to use two tasks: <em>smartbuild</em><em> </em>for all the builds and <em>export.database</em> to export database to xml files. <em>export.database </em>is now smart to export only if needed, skipping the process if no changes have happened in the local Openbravo model.</p>
<p>Moreover <em>update.database </em>ensures before updating that no local changes have occured in Openbravo model since the last synchronization (<em>export.database </em>or <em>update.database</em>) to prevent people loosing their changes. In case of changes, people will be required to export their database before updating it.</p>
<h2>How it works</h2>
<ul>
<li><strong>Determine if database needs to be updated. </strong>To do this <em>smartbuild</em> generates a checksum for the xml files and compares it with an existent one. This one is generated each time database is synchronized from xml files or to xml files. If the two checksums are different it means that xml files are different so database is updated.</li>
<li><strong>Decide which code needs to be re-generated. </strong>Whenever a build process is done a timestamp with the current time is stored in database. This timestamp is compared with the audit info for the application dictionary objects that participate in the code generation so now WAD is able to generate code only for those elements that have been created or modified after the last build. Additionally when exporting database to xml files the audit info is not longer exported and when updating the audit info is recalculated for the current time, thus it also works in case the modifications in application dictionary came from an <em>update.database. </em>There&#8217;s only one case when this check doesn&#8217;t work: it is when application dictionary elements are modified directly in databse through <em>insert/update </em>SQL statements without updating audit info. In this case the developer will have to generate the code in the old way (using <em>compile -Dtab=modifiedWindows</em>).</li>
<li><strong>Check if database has been changed. </strong>This check allows to export only if there&#8217;re changes in database and prevents data loses when updating database. To check this it is used the same timestamp as in the first point. Modifications in data are calculeted by DAL and modifications in database structure are queried directly to database. The query for database structure last modification has no problem in Oracle becuase <em>User_Objects</em> table stores the last physical change for each database object, but in PostgreSQL that information is not stored in database. This has been solved for PostgreSQL generating a checksum in database from all the elements in database that can be exported to xml files, that&#8217;s the reason why in PostgreSQL this check takes longer than in Oracle.</li>
</ul>
Posted in Openbravo Tagged: developers utilities, r2.50 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alostale.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alostale.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alostale.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alostale.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alostale.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alostale.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alostale.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alostale.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alostale.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alostale.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=95&subd=alostale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alostale.wordpress.com/2009/02/09/new-build-process-keep-it-simple/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">alostale</media:title>
		</media:content>
	</item>
		<item>
		<title>Multithread safe servlets</title>
		<link>http://alostale.wordpress.com/2009/01/30/multithread-safe-servlets/</link>
		<comments>http://alostale.wordpress.com/2009/01/30/multithread-safe-servlets/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 08:23:59 +0000</pubDate>
		<dc:creator>alostale</dc:creator>
				<category><![CDATA[Openbravo]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://alostale.wordpress.com/?p=81</guid>
		<description><![CDATA[This posts explains the multithreading safety problem and explains how it can be prevented. I&#8217;m writing about it because recently I&#8217;ve fixed a bug in Openbravo ERP related with issue, and I would like to remind developers about this problem to take it into account.
The way Tomcat manages servlets is creating one instance of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=81&subd=alostale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This posts explains the multithreading safety problem and explains how it can be prevented. I&#8217;m writing about it because recently I&#8217;ve fixed a <a href="https://issues.openbravo.com/view.php?id=6283">bug</a> in Openbravo ERP related with issue, and I would like to remind developers about this problem to take it into account.</p>
<p>The way Tomcat manages servlets is creating one instance of the object and having multiple threads invoking methods on that instance, each of these threads is serving each of the multiple simultaneous request. Thus a single servlet instance can be used at the same time by different users.</p>
<p>All this must be kept in mind when developing servlets in order to prevent dirty global properties readings. Let me explain through a little example, let&#8217;s define a servlet:</p>
<pre style="padding-left:30px;">public class Test extends HttpServlet {
private String st;

  public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws IOException, ServletException {
    st = readStringFromSomewhereElse();
    //... do other stuff here
    System.out.println(st);
  }
}</pre>
<p>In this case there could be two users accessing the <em>doPost</em> method simultaneously using the same instance of <em>Test</em> class, the first one could set the st as &#8220;A&#8221; and before printing its value the second one could set it as &#8220;B&#8221;, the the first one would print &#8220;B&#8221; instead of &#8220;A&#8221; as it would expect. In this case this property would have a <em>static </em>behavior.</p>
<p>So this pattern should be avoided when developing servlets, this is, there should not be global properties modified in the <em>doPost</em> method (or in any other one called from it).  Generally, this can be easily solved using variables inside the <em>doPost</em> method instead of global properties. In fact, global properties should be initialized just once in the <em>init</em> method and not modified afterwards.</p>
Posted in Openbravo Tagged: Java <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alostale.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alostale.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alostale.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alostale.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alostale.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alostale.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alostale.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alostale.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alostale.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alostale.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=81&subd=alostale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alostale.wordpress.com/2009/01/30/multithread-safe-servlets/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">alostale</media:title>
		</media:content>
	</item>
		<item>
		<title>New stuff for Openbravo ERP developers</title>
		<link>http://alostale.wordpress.com/2008/11/13/new-stuff-for-openbravo-erp-developers/</link>
		<comments>http://alostale.wordpress.com/2008/11/13/new-stuff-for-openbravo-erp-developers/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 12:27:41 +0000</pubDate>
		<dc:creator>alostale</dc:creator>
				<category><![CDATA[Openbravo]]></category>
		<category><![CDATA[developers utilities]]></category>
		<category><![CDATA[modularity]]></category>
		<category><![CDATA[r2.50]]></category>

		<guid isPermaLink="false">http://alostale.wordpress.com/?p=70</guid>
		<description><![CDATA[Recently modularity project has been merged back to Openbravo ERP 2.50 trunk. Apart from the features described within the project, some other useful utilities have been developed, these features are usable from r2.50 by any development. Some of them are:
GenericTree

GenericTree allows to represent an ajax tree for any tree data structure in Openbravo ERP. It [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=70&subd=alostale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently modularity project has been merged back to Openbravo ERP 2.50 <a href="https://dev.openbravo.com/svn/openbravo/trunk">trunk</a>. Apart from the features described within the <a href="http://wiki.openbravo.com/wiki/Projects/Modularity/Specifications">project</a>, some other useful utilities have been developed, these features are usable from r2.50 by any development. Some of them are:</p>
<h2>GenericTree</h2>
<p style="text-align:center;"><a href="http://alostale.files.wordpress.com/2008/10/generictree.png"><img class="size-medium wp-image-72 aligncenter" src="http://alostale.files.wordpress.com/2008/10/generictree.png?w=300&#038;h=63" alt="GenericTree" width="300" height="63" /></a></p>
<p style="padding-left:30px;">GenericTree allows to represent an ajax tree for any tree data structure in Openbravo ERP. It draws the user interface for the tree and manages the ajax calls for opening and closing nodes.</p>
<p style="padding-left:30px;">GenericTree is an abstract Java class that can be extended by other classes to implement different trees. These subclasses just need to populate a FieldProvider object with the information for the concrete tree. Once this is done in order to show an ajax tree it is only needed to instantiate a subclass.</p>
<p style="padding-left:30px;">Let&#8217;s see some code:</p>
<p style="padding-left:30px;">This is the Java piece of code<br />
<code><br />
<strong>ModuleTree tree = new ModuleTree(this)</strong>;<br />
tree.setLanguage(vars.getLanguage());<br />
//Obtains a tree for the installed modules<br />
xmlDocument.setParameter("moduleTree", <strong>tree.toHtml()</strong>);<br />
//Obtains a box for display the modules descriptions<br />
xmlDocument.setParameter("moduleTreeDescription", tree.descriptionToHtml());<br />
</code></p>
<p style="padding-left:30px;">And here is the HTML side</p>
<p style="padding-left:30px;"><code><br />
</code><code>&lt;tr&gt;<br />
<strong>&lt;PARAMETER_TMP id="</strong></code><strong><code>moduleTree</code></strong><code><strong>"/&gt; </strong>&lt;!-- Prints module tree 4 cols --&gt;<br />
&lt;td/&gt;<br />
&lt;td/&gt;<br />
&lt;tr&gt;</code></p>
<p style="padding-left:30px;">&#8230;</p>
<p style="padding-left:30px;"><code> &lt;tr&gt;<br />
<strong>&lt;PARAMETER_TMP id="moduleTreeDescription"/&gt;</strong> &lt;!-- Prints module tree desc  4 cols --&gt;<br />
&lt;td/&gt;<br />
&lt;td/&gt;<br />
&lt;tr&gt;<br />
</code></p>
<p style="padding-left:30px;">In this example ModuleTree class is a GenericTree&#8217;s subclass which implements the queries for the tree of modules, creating a new instance of this class and setting the toHTML() in the HTML template will display the User Interface and manage all the ajax requests.</p>
<h2>FieldProviderFactory</h2>
<p style="padding-left:30px;">This class allows to transform any object with setter methods into a FieldProvider object. This is useful to represent this non-FieldProvider object within a structure inside a xmlEngine template.</p>
<p style="padding-left:30px;">Here&#8217;s the code:</p>
<p style="padding-left:30px;"><code><br />
WebServiceImplServiceLocator loc = new WebServiceImplServiceLocator();<br />
WebServiceImpl ws = (WebServiceImpl) loc.getWebService();<br />
Module module = ws.moduleDetail(recordId);<br />
ModuleDependency[] dependencies = module.getDependencies();<br />
xmlDocument.setData("dependencies", <strong>FieldProviderFactory.getFieldProviderArray(dependencies)</strong>);<br />
</code></p>
<p style="padding-left:30px;">In this example ModuleDependency is a class that has setter methods, so to use it to fill a HTML template it is possible to convert it into a FieldProvider using FieldProviderFactory class.</p>
<h2>AntExecutor</h2>
<p style="padding-left:30px;">AntExecutor is able to execute any ant task from any build.xml file. It is also possible to set different loggers, for example a file log or an OBPrintStream which can be used to display the generated log in real time.</p>
<p style="padding-left:30px;">This is a basic example that just creates a new AntExecutor for a buil.xml file, adds a task and a property and executes the task.</p>
<p style="padding-left:30px;"><code><br />
AntExecutor ant=new AntExecutor("/path/to/build.xml");<br />
Vector tasks = new Vector();<br />
tasks.add("apply.modules");<br />
ant.setProperty("module", "test1");<br />
ant.runTask(tasks);<br />
</code></p>
<h2>Zip</h2>
<p style="padding-left:30px;">Zip class zips and unzips files.</p>
<p style="padding-left:30px;">It is easy to use:</p>
<p style="padding-left:30px;"><code><br />
Zip.zip("/path/to/zip/", "/file/to.zip");<br />
Zip.unzip("/file/to/un.zip", "/path/to/unzip");<br />
</code></p>
Posted in Openbravo Tagged: developers utilities, modularity, r2.50 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alostale.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alostale.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alostale.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alostale.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alostale.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alostale.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alostale.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alostale.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alostale.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alostale.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=70&subd=alostale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alostale.wordpress.com/2008/11/13/new-stuff-for-openbravo-erp-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">alostale</media:title>
		</media:content>

		<media:content url="http://alostale.files.wordpress.com/2008/10/generictree.png?w=300" medium="image">
			<media:title type="html">GenericTree</media:title>
		</media:content>
	</item>
		<item>
		<title>Subversion 1.5 merge problems</title>
		<link>http://alostale.wordpress.com/2008/10/08/subversion-15-merge-problems/</link>
		<comments>http://alostale.wordpress.com/2008/10/08/subversion-15-merge-problems/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 06:34:49 +0000</pubDate>
		<dc:creator>alostale</dc:creator>
				<category><![CDATA[Openbravo]]></category>
		<category><![CDATA[branches]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://alostale.wordpress.com/?p=65</guid>
		<description><![CDATA[Last days we have had several problems trying to merge two branches using subversion. I wanted to merge trunk to modularity but I always obtained this error:
svn: Working copy path 'lib/runtime' does not exist in repository
This happened using any merge command (svn merge modularity, svn merge trunk@r1 trunk@r2&#8230;).
It seems to be related with subversion issue [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=65&subd=alostale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Last days we have had several problems trying to merge two branches using subversion. I wanted to merge trunk to modularity but I always obtained this error:</p>
<pre><code>svn: Working copy path 'lib/runtime' does not exist in repository</code></pre>
<p>This happened using any merge command (svn merge modularity, svn merge trunk@r1 trunk@r2&#8230;).<br />
It seems to be related with subversion <a href="http://subversion.tigris.org/issues/show_bug.cgi?id=3067">issue 3067</a> and the only way to make it work was checking out the svn branch that solves this issue compiling it and using it to do the merge. The steps to do that are:</p>
<p>1) svn co http://svn.collab.net/repos/svn/branches/issue-3067-deleted-subtrees/ svn-mod<br />
2) cd svn-mod<br />
3) ./autogen.sh<br />
4) ./configure<br />
5) make</p>
<p>After doing the merge using that svn client the working copy cannot be used anymore with the old svn client.</p>
Posted in Openbravo Tagged: branches, scm, subversion <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alostale.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alostale.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alostale.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alostale.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alostale.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alostale.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alostale.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alostale.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alostale.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alostale.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=65&subd=alostale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alostale.wordpress.com/2008/10/08/subversion-15-merge-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">alostale</media:title>
		</media:content>
	</item>
		<item>
		<title>New column in Openbravo ERP prone to merge conflicts</title>
		<link>http://alostale.wordpress.com/2008/10/03/new-column-in-openbravo-erp-prone-to-merge-conflicts/</link>
		<comments>http://alostale.wordpress.com/2008/10/03/new-column-in-openbravo-erp-prone-to-merge-conflicts/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 13:01:54 +0000</pubDate>
		<dc:creator>alostale</dc:creator>
				<category><![CDATA[Openbravo]]></category>
		<category><![CDATA[branches]]></category>
		<category><![CDATA[r2.50]]></category>

		<guid isPermaLink="false">http://alostale.wordpress.com/?p=58</guid>
		<description><![CDATA[Recently I&#8217;ve added to AD_Column table in Openbravo ERP database the Position column and I&#8217;ve commited it to trunk (r8191). This new column stores the physical database order for the columns which will be required by Data Access Layer Project.
This column is mandatory, so when mergeing trunk to project branches it will cause problems in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=58&subd=alostale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently I&#8217;ve added to <em>AD_Column</em> table in Openbravo ERP database the <em>Position</em> column and I&#8217;ve commited it to trunk (r8191). This new column stores the physical database order for the columns which will be required by <a href="http://wiki.openbravo.com/wiki/Projects/Data_Access_Layer/Functional_Specification"><em>Data Access Layer Project</em></a>.</p>
<p>This column is mandatory, so when mergeing trunk to project branches it will cause problems in case these projects add new columns. Here I will try to explain who to deal with these problems:</p>
<ul>
<li>First of all resolve the conflicts as usual in the xml files.</li>
<li>If you have created new columns in your project you will not be able to update your database, so before updating let&#8217;s put the new column as not mandatory open <em>src-db/database/model/tables/AD_COLUMN.xml</em> file and change the line <code>&lt;column name="POSITION" primaryKey="false" required="<strong>true</strong>" type="DECIMAL" autoIncrement="false"&gt;</code> to <code>&lt;column name="POSITION" primaryKey="false" required="<strong>false</strong>" type="DECIMAL" autoIncrement="false"&gt;</code>. Now you should be able to update your database.</li>
<li>Your database now contains the columns you&#8217;ve added to your project with the position value as null, now you have to populate this value to do it execute:</li>
</ul>
<p style="padding-left:30px;"><code> UPDATE AD_COLUMN C<br />
SET POSITION=(SELECT COLUMN_ID FROM USER_TAB_COLUMNS U, AD_TABLE T<br />
WHERE T.AD_TABLE_ID = C.AD_TABLE_ID<br />
AND TABLE_NAME = UPPER(T.TABLENAME)<br />
AND COLUMN_NAME = UPPER(C.COLUMNNAME))<br />
WHERE POSITION IS NULL;</code></p>
<ul>
<li>Export now your database to xml files.</li>
<li>Revert the previous modification in <em>src-db/database/model/tables/</em><em>AD_COLUMN.xml</em> file.</li>
<li>And now you are ready to commit</li>
</ul>
Posted in Openbravo Tagged: branches, r2.50 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alostale.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alostale.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alostale.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alostale.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alostale.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alostale.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alostale.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alostale.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alostale.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alostale.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alostale.wordpress.com&blog=4387311&post=58&subd=alostale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alostale.wordpress.com/2008/10/03/new-column-in-openbravo-erp-prone-to-merge-conflicts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">alostale</media:title>
		</media:content>
	</item>
	</channel>
</rss>