-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Incorrect SQL syntax suddenly being generated
PostPosted: Wed Apr 11, 2007 9:00 pm 
Newbie

Joined: Wed Apr 11, 2007 8:38 pm
Posts: 2
Location: Melbourne,Australia
Application has been running now for two years and suddenly every insert statement has "select scope_identity()" appended to it causing a SQLGrammar exception.

Hibernate: insert into record_verify (au_vers_numb, table_code, row_created_by, row_datetime_cb, row_last_mod_by, row_datetime_lmb, midistats_id, error_number) values (?, ?, ?, ?, ?, ?, ?, ?) select scope_identity()

This just happened one day to the next. There have been NO changes to the operating environment.

Tomcat 5.5.12, running as localhost on an AMD64 box running Debian.
The version visible to the "outside world" is running fine, identical software environment, but using an Intel chipset.

Hibernate version: 3.1.3

Mapping documents:

[12-04-07 10:44:50] DEBUG : Hibernate Interceptor: onSave
[12-04-07 10:44:50] DEBUG : binding '0' to parameter: 1
[12-04-07 10:44:50] DEBUG : binding 'E' to parameter: 2
[12-04-07 10:44:50] DEBUG : binding '1' to parameter: 3
[12-04-07 10:44:50] DEBUG : binding '2005-03-30 13:12:35' to parameter: 4
[12-04-07 10:44:50] DEBUG : binding '1' to parameter: 5
[12-04-07 10:44:50] DEBUG : binding '2007-04-12 10:44:50' to parameter: 6
[12-04-07 10:44:50] DEBUG : binding '18' to parameter: 7
[12-04-07 10:44:50] DEBUG : binding '110' to parameter: 8
[12-04-07 10:44:50] WARN : SQL Error: 0, SQLState: 42601
[12-04-07 10:44:50] ERROR : ERROR: syntax error at or near "select"

[12-04-07 10:44:50] ERROR : Error storing Record_Verify




Name and version of the database you are using: Postgres 7.4.7

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:
[12-04-07 10:44:50] DEBUG : (NullableType.java:nullSafeSet:80)
binding '0' to parameter: 1

[12-04-07 10:44:50] DEBUG : (NullableType.java:nullSafeSet:80)
binding 'E' to parameter: 2

[12-04-07 10:44:50] DEBUG : (NullableType.java:nullSafeSet:80)
binding '1' to parameter: 3

[12-04-07 10:44:50] DEBUG : (NullableType.java:nullSafeSet:80)
binding '2005-03-30 13:12:35' to parameter: 4

[12-04-07 10:44:50] DEBUG : (NullableType.java:nullSafeSet:80)
binding '1' to parameter: 5

[12-04-07 10:44:50] DEBUG : (NullableType.java:nullSafeSet:80)
binding '2007-04-12 10:44:50' to parameter: 6

[12-04-07 10:44:50] DEBUG : (NullableType.java:nullSafeSet:80)
binding '18' to parameter: 7

[12-04-07 10:44:50] DEBUG : (NullableType.java:nullSafeSet:80)
binding '110' to parameter: 8

[12-04-07 10:44:50] WARN : (JDBCExceptionReporter.java:logExceptions:71)
SQL Error: 0, SQLState: 42601

[12-04-07 10:44:50] ERROR : (JDBCExceptionReporter.java:logExceptions:72)
ERROR: syntax error at or near "select"


[12-04-07 10:44:50] DEBUG : (NullableType.java:nullSafeSet:80)
binding '38' to parameter: 1

[12-04-07 10:44:50] WARN : (JDBCExceptionReporter.java:logExceptions:71)
SQL Error: 0, SQLState: 25P02

[12-04-07 10:44:50] ERROR : (JDBCExceptionReporter.java:logExceptions:72)
ERROR: current transaction is aborted, commands ignored until end of transaction block


[12-04-07 10:44:50] ERROR : (AssertionFailure.java:<init>:22)
an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)



Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 11:07 pm 
Newbie

Joined: Wed Apr 11, 2007 8:38 pm
Posts: 2
Location: Melbourne,Australia
Finally found the cause of the error.
Incorrect DAO factory being used.

Sorry if I inconvenienced anybody.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.