You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Victor Oomens <vi...@oomens-ict.nl> on 2015/01/29 16:10:00 UTC

incremental number field in domain object

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

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
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 <vi...@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 <
> dan@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 <vi...@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

Posted by Victor Oomens <vi...@oomens-ict.nl>.
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 <da...@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 <vi...@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 - solved

Posted by Victor Oomens <vi...@oomens-ict.nl>.
Found it:

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

in persistor_datanucleus.properties.

Solved



> Op 29 jan. 2015, om 16:22 heeft Dan Haywood <da...@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 <vi...@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

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
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 <vi...@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
>
>