db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: db-ojb/xdocs faq.xml
Date Sat, 14 Jun 2003 22:06:43 GMT
thma        2003/06/14 15:06:43

  Modified:    xdocs    faq.xml
  Log:
  add an Optimistic Locking howto
  
  Revision  Changes    Path
  1.22      +52 -4     db-ojb/xdocs/faq.xml
  
  Index: faq.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/xdocs/faq.xml,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- faq.xml	11 Jun 2003 14:02:42 -0000	1.21
  +++ faq.xml	14 Jun 2003 22:06:43 -0000	1.22
  @@ -65,6 +65,7 @@
       <li><a href="#FAQ30">Is it possible to use OJB within EJB's?</a></li>
   	<li><a href="#FAQ36">Can OJB handle ternary (or higher) associations?</a></li>
   	<li><a href="#How to map a list of Strings">How to map a list of Strings</a></li>
  +	<li><a href="#How to set up Optimistic Locking">How to set up Optimistic Locking</a></li>
   
      </ul>
   
  @@ -373,11 +374,31 @@
   
   		Of course we are using OJB in those Systems!
   		We have several OJB based systems now in production for over a year.
  -		We never had any OJB releated problems in production.<br/>
  +		We never had any OJB related problems in production.<br/>
   
   		Most problems we faced during development were related to the
   		learning curve developers had to face who were new to O/R mapping."
   	</p>
  +	
  +	<p>
  +		"I've also worked with OJB on high-load situations in J2EE environments. 
  +		We're using JRun and/or Orion with OJB in a clustered/distributed
  +		environment. This is a National Science Foundation project called the
  +		Network for Earthquake Engineering Simulation (NEES).<br/>
  +		
  +		The only major problem that we ran into was the cache.  JCS just isn't
  +		good, and hasn't seemed to get much better over the last year.  We ended
  +		up plugging in Tangosol's Coherence Clustered Cache into the system.  We
  +		can also do write-behinds, and buffered data caching that is queued for
  +		transaction.  That's important to us because we're dealing with very
  +		expensive scientific data that _can't_ get lost if a db goes down. Some
  +		of these Tsunami experiments can get pretty expensive.<br/>
  +		
  +		Otherwise, we use mostly the PersistenceBroker, and a little of the
  +		ODMG.  Performance seems better on PB, but less functional.  It's not
  +		really that much of a problem anyway, because we can cheaply and quickly
  +		add app-servers to the cluster."
  +	</p>
   
       </subsection>
   
  @@ -1246,11 +1267,38 @@
   "o.a.ojb.broker.accesslayer.conversions.StringVector2VarcharFieldConversion"
   />
   ]]></source>
  -
  -
   	</subsection>
   
  -
  +	<subsection name="How to set up Optimistic Locking">
  +	<ol>
  +		<li>
  +			In your table you need a dedicated column of type <code>INTEGER</code> 
  +			or <code>TIMESTAMP</code>.
  +			Say the column is typed as <code>INTEGER</code> and named 
  +			<code>VERSION_MAINTAINED_BY_OJB</code>.
  +		</li>
  +		<li>
  +			You then need a (possibly private) attribute in your java class corresponding to the
column.
  +			Say the attribute is defined as:
  +			<source>private int versionMaintainedByOjb;</source>
  +		</li>
  +		<li>
  +			in repository.xml you need a field-descriptor for this attribute.
  +   			this field-descriptor must specify <code>locking="true"</code> 
  +		</li>
  +		The resulting field-descriptor will look as follows:
  +		<source><![CDATA[
  +<field-descriptor
  +	name="versionMaintainedByOjb"
  +	column="VERSION_MAINTAINED_BY_OJB"
  +	jdbc-type="INTEGER"
  +	locking="true"
  +/>
  +		]]></source>
  +	</ol>
  +	For further reference see also 
  +	<a href="repository.html#field-descriptor">the repository documentation</a>.
  +	</subsection>
     </section>
    </body>
   </document>
  
  
  

Mime
View raw message