-
1. Re: 4.0.4.CR2 => 4.0.4.GA @SequenceGenerator now ignored...
supernovasoftware.com May 31, 2006 1:36 PM (in response to supernovasoftware.com)I just found the JIRA issue for this which has a workaround.
http://jira.jboss.com/jira/browse/EJBTHREE-597
Could someone please comment on the status of this issue? -
2. Re: 4.0.4.CR2 => 4.0.4.GA @SequenceGenerator now ignored...
supernovasoftware.com May 31, 2006 3:13 PM (in response to supernovasoftware.com)The following workaround from JIRA worked.
@Entity @Table(name="t_size") @GenericGenerator(name="seq_size", strategy = "sequence", parameters = { @Parameter(name="sequence", value="seq_size") } ) public class Size implements Serializable { private Long id; @Id @GeneratedValue( strategy=GenerationType.SEQUENCE, generator="seq_size") public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } ... }
Thanks David. -
3. Re: 4.0.4.CR2 => 4.0.4.GA @SequenceGenerator now ignored...
dbudworth Jun 1, 2006 10:21 AM (in response to supernovasoftware.com)Had the same problem here, and the workaround was the only way to get the sequences to be used.
This was on 4.0.4 GA (using EJB3 exactly as shipped with 4.0.4 GA), and oracle 10g (but it seems to not be database specific) -
4. Re: 4.0.4.CR2 => 4.0.4.GA @SequenceGenerator now ignored...
epbernard Jun 1, 2006 9:32 PM (in response to supernovasoftware.com)@SequenceGenerator(allocationSize=1) is the way to do it property
-
5. Re: 4.0.4.CR2 => 4.0.4.GA @SequenceGenerator now ignored...
supernovasoftware.com Jun 1, 2006 10:17 PM (in response to supernovasoftware.com)Thank you Emmanuel. The following does in fact work for me.
private Long id; @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_coupling_spec") @Id @SequenceGenerator(name = "seq_coupling_spec", sequenceName = "seq_coupling_spec", allocationSize=1) public Long getId() { return this.id; } public void setId(Long id) { this.id = id; }
Could you please tell me why 1 is not the default or allocationSize a required parameter?
If this is not specified it seems to ignore the entire tag. -
6. Re: 4.0.4.CR2 => 4.0.4.GA @SequenceGenerator now ignored...
epbernard Jun 2, 2006 12:05 PM (in response to supernovasoftware.com)Hum, I'm actually realizing right now that we made a mistake on the default allocationSize.
It is 50 right now ; while more efficient, this is not the "default" people expect -
7. Re: 4.0.4.CR2 => 4.0.4.GA @SequenceGenerator now ignored...
supernovasoftware.com Jun 2, 2006 12:10 PM (in response to supernovasoftware.com)Actually some other strategy is used if this is left out.
For example one my sequence was at 18, but without the allocation size specified is was getting numbers close to 3000 and not incrementing my sequence at all.