Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

j2se with persistence java api

  Asked By: Willie    Date: Nov 18    Category: Java    Views: 2043
  

what is this error in runtime

my database is mysql.

error :

[root@localhost per]# java Test
1
[TopLink Info]: 2008.04.17 10:38:49.719--ServerSession(3203712)--TopLink, version: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))
[TopLink Info]: 2008.04.17 10:38:50.149--ServerSession(3203712)--file:/root/Public/per/-test login successful
2
3
[TopLink Warning]: 2008.04.17 10:38:50.227--ClientSession(17680053)--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'test.SEQUENCE' doesn't exist
Error Code: 1146
Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
bind => [50, SEQ_GEN]
Query: DataModifyQuery()
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'test.SEQUENCE' doesn't exist
Error Code: 1146
Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
bind => [50, SEQ_GEN]
Query: DataModifyQuery()
5
finish

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Rachel Barnes     Answered On: Nov 18

There is your problem:

Table 'test.SEQUENCE' doesn't exist

 
Answer #2    Answered By: Julio Morgan     Answered On: Nov 18

finally i could solve my problem. Now I know that mysql  dosen't use sequences.
but Oracle and PostgreSQL do.
I should change my toplink configuration. Is there any idea or instruction?
I eliminated @GeneratedValue from my code and my program works without any error  :D.
but this solution dosent make me satisfy because my program is damaged and this is not exactly that i wanted?
please help rebuilt my persistence.xml with new toplink configuration.

 
Answer #3    Answered By: Opal Alexander     Answered On: Nov 18

What if you keep @GeneratedValue but with a different strategy? There is a handful of them in GenerationType enum.

 
Didn't find what you were looking for? Find more on j2se with persistence java api Or get search suggestion and latest updates.




Tagged: