Dear

I was using TableGenerator as below

  | @TableGenerator(name = "IdGen", 
  |                     table = "ID_GENERATOR", 
  |                     pkColumnName = "ID_NO",
  |                     pkColumnValue = "1",
  |                     valueColumnName = "NEXT_VALUE",
  |                     allocationSize = 1)
  | public class Board extends AbstractResultValue {
  |    ........
  | }
  | 

and the value of "NEXT_VALUE" column of "ID_GENERATOR" table is 1008.



and Pk field has the annotation as below

  |     @Column(name = "BOARD_SEQ")
  |     @Id @GeneratedValue(strategy=GenerationType.TABLE, generator="IdGen") 
  |     public Integer getBoardSeq() {
  |         return boardSeq;
  |     }
  | 

and the value of "NEXT_VALUE" column of "ID_GENERATOR" table is 1008.

I've expected that the value of the boardSeq field is 1008, but it has 2016.

So there is the output message of debug mode of JBoss Application Server as 
below.

15:49:59,203 DEBUG [SQL] select NEXT_VALUE from ID_GENERATOR where ID_NO = '1' 
for update
15:49:59,531 DEBUG [AbstractBatcher] closing JDBC connection (open 
PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
15:49:59,609 DEBUG [Isolater] surrounding JTA transaction resumed 
[TransactionImpl:XidImpl[FormatId=257, GlobalId=RitchieKoh/14, BranchQual=, 
localId=14]]
15:49:59,609 DEBUG [MultipleHiLoPerTableGenerator] new hi value: 1008
15:49:59,609 DEBUG [AbstractSaveEventListener] generated identifier: 2016, 
using strategy: org.hibernate.id.MultipleHiLoPerTableGenerator

At the above message, MultipleHiLoPerTableGenerator is getting the my expected 
value(1008), 
but finally the boardSeq field is inserted the 2016 value.

I've thought that the boardSeq value is 1008 from "NEXT_VALUE" column of 
"ID_GENERATOR" table. but the boardSeq has 2016 finally.

Why did get the 2016 value instead of 1008
Please let me know why?

# Ritchie

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3933034#3933034

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3933034


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to