Re: incremental number field in domain object

2015-01-29 Thread Dan Haywood
Hi Victor,

That's really a JDO/DataNucleus question; Isis just delegates to
DataNucleus to do its thang.

This page might help [1].  FWIW, we tend to use IDENTITY rather than
INCREMENT.

Cheers
Dan


[1]
http://www.datanucleus.org/products/datanucleus/jdo/value_generation.html#increment

On 29 January 2015 at 15:10, Victor Oomens vic...@oomens-ict.nl wrote:

 Hi,

 I’ve defined an incremental field in a domain object like this:

 @Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT)
 private long invoicenumber;

 This works fine, but there’s a small problem. Sometimes the NEXT_VALUE
 skips a couple of numbers. Where did I go wrong?

 Cheers,

 Victor




Re: incremental number field in domain object

2015-01-29 Thread Dan Haywood
The DataNucleus page [1] says that the following persistence property is
required:

   datanucleus.valuegeneration.increment.allocationSize

To specify this through Isis, add it into one of the Isis config files (eg
persistor_datanucleus.properties or if you prefer even isis.properties will
do) with the prefix isis.persistor.datanucleus.impl.; that is:


 
isis.persistor.datanucleus.impl.datanucleus.valuegeneration.increment.allocationSize
= ...

Isis will pass this property through directly (stripping off its prefix).

~~~
There's another example for a simpler property documented here on Isis'
website [2]


HTH
Dan

[1]
http://www.datanucleus.org/products/datanucleus/jdo/value_generation.html#increment
[2]
http://isis.apache.org/components/objectstores/jdo/disabling-persistence-by-reachability.html






On 29 January 2015 at 15:45, Victor Oomens vic...@oomens-ict.nl wrote:

 Thx,

 It seems I have to set the key-cache-size in the jdo meta data. Where can
 I put that value in Isis?


  Op 29 jan. 2015, om 16:22 heeft Dan Haywood 
 d...@haywood-associates.co.uk het volgende geschreven:
 
  Hi Victor,
 
  That's really a JDO/DataNucleus question; Isis just delegates to
  DataNucleus to do its thang.
 
  This page might help [1].  FWIW, we tend to use IDENTITY rather than
  INCREMENT.
 
  Cheers
  Dan
 
 
  [1]
 
 http://www.datanucleus.org/products/datanucleus/jdo/value_generation.html#increment
 
  On 29 January 2015 at 15:10, Victor Oomens vic...@oomens-ict.nl wrote:
 
  Hi,
 
  I’ve defined an incremental field in a domain object like this:
 
  @Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT)
  private long invoicenumber;
 
  This works fine, but there’s a small problem. Sometimes the NEXT_VALUE
  skips a couple of numbers. Where did I go wrong?
 
  Cheers,
 
  Victor