Because, once I enable my sessionCustomizer class, eclipselink no longer 
uses the correct statement (CALL NEXT VALUE FOR), but instead uses : 

[EL Fine]: 2013-02-22 
14:50:01.291--ClientSession(2052114141)--Connection(1340006540)--Thread(Thread[main,5,main])--UPDATE
 
SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
bind => [50, SYSTEM_SEQUENCE_1E71BBBC_0444_4E1D_A3A5_DD4483BD30EE]


All I changed in the session Customizer class was setSequenceNumberName.

I came up with a workaround where I now, instead of using auto increment 
when creating the tables, I createmy own sequences and set the default 
value of the column to :
"DEFAULT (NEXT VALUE FOR PUBLIC.MY_SEQUENCE_TABNAME ) NOT NULL 
NULL_TO_DEFAULT SEQUENCE PUBLIC.MY_SEQUENCE_TABNAME";

Then in my persistence entity classes, I set the sequence name.
@GeneratedValue(strategy = GenerationType.AUTO, generator="GEN_TABNAME")
@SequenceGenerator(name = "GEN_TABNAME", sequenceName = 
"MY_SEQUENCE_TABNAME", allocationSize = 1)


It's not ideal, I would still prefer a way where eclipselink figures out 
the sequence name of an auto_increment field and uses that correctly, but 
it works.

Thanks,

Droes

On Tuesday, February 26, 2013 10:25:01 AM UTC+1, Noel Grandin wrote:
>
>  
> On 2013-02-22 15:55, Dries wrote:
>  
> I'm able to make that statement work on the correct tables and fields in 
> h2, but h2 doesn't allow changes to meta tables, so that doesn't solve the 
> problem either. 
> login.getPlatform().setSequenceCounterFieldName("CURRENT_VALUE");
> login.getPlatform().setSequenceNameFieldName("SEQUENCE_NAME");
> login.getPlatform().setSequenceTableName("INFORMATION_SCHEMA.SEQUENCES");
> login.getPlatform().setSequencePreallocationSize(1);
>  
>   [EL Fine]: 2013-02-22 
> 14:52:15.602--ClientSession(1205789719)--Connection(1834774659)--Thread(Thread[main,5,main])--UPDATE
>  
> INFORMATION_SCHEMA.SEQUENCES SET CURRENT_VALUE = CURRENT_VALUE + ? WHERE 
> SEQUENCE_NAME = ?
>   bind => [1, SYSTEM_SEQUENCE_1E71BBBC_0444_4E1D_A3A5_DD4483BD30EE]
>  
>
>  
>  That statement is not allowed because it updates meta tables.
>
>  
>  
> Why are you trying to update meta tables instead of using standard SQL to 
> modify the sequence?
>
> http://h2database.com/html/grammar.html#alter_sequence
>  

-- 
*
*
*

Confidentiality Notice:  *
The information in this email is confidential and privileged.  If you are 
the intended recipient and you have a current Non-Disclosure Agreement in 
place between your entity and Security Weaver any content contained or 
implied by this email should be considered within the scope of that 
agreement.  If the recipient of this message is not the intended recipient, 
any disclosure, copying, distribution, retention or action taken or omitted 
to be taken in reliance on it is prohibited.  Please notify us immediately 
by replying to the message or by telephoning +1- 800-620-4210 and deleting 
it and any attachments from your computer system.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to