• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Internal Exception: java.sql.SQLException: Invalid object name

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys! Whenever I'm trying to INSERT something to the database I get this error.


Internal Exception: java.sql.SQLException: Invalid object name 'SEQUENCE'.Error Code: 208 Call:UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ? bind => [50, SEQ_GEN] Query ataModifyQuery()



But when I try to edit/delete existing data everything works fine...

I'm using JPA with Toplink as my persistence manager. Here's my model



I don't want to blame SQLServer 2005 yet. Could you guys please help me determine the source of the problem? Thanks!
[ May 02, 2007: Message edited by: Timothy Sam ]
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I might be way off target, but going by the error message it looks like the query is being fired for auto generating the ids when inserting an object. However, as far as i know, "SEQUENCE" is an Oracle specific construct and might not work for SQLServer. I am surprised why this query is getting generated for SQLServer.
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! I changed

@GeneratedValue(strategy=GenerationType.AUTO)

to

@GeneratedValue(strategy=GenerationType.IDENTITY)

and it worked! Weird eh?
 
Greenhorn
Posts: 1
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The odd thing about it was the @GeneratedValue(strategy=GenerationType.AUTO) worked for a number of builds until I changed one of my controllers and then it start to pull SEQUENCE instead of IDENTITY.
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic