I tried the following code to run a bulk update - I changed the query from a complicated one to this simplest one though makes no sense by itself. However, I got the exception below. I am using Sybase ASE 12 and Hibernate 3. I highlighted the SQL it tried to execute and really don't understand why it did insertion.
I am really confused. Please advise! Thanks!!
[Code] ==================
session = getSession();
Query query = session.createQuery("DELETE PartyRelationship p WHERE p.id = :id");
query.setLong("id", id);
query.executeUpdate();
[Exception In Console] ===========
[b]Hibernate: insert into #tbl_party_relationship select bulk_target.party_relationship_id as party_relationship_id from dbo.tbl_party_relationship bulk_target where party_relationship_id=?
[/b]
Oct 12, 2007 4:26:41 PM org.apache.commons.logging.impl.Jdk14Logger warn
WARNING: unable to drop temporary id table after use
java.sql.SQLException: Cannot drop the table '#tbl_party_relationship', because it doesn't exist in the system catalogs.
...
[Exception in JUNIT} =============
org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.SQLGrammarException: could not insert/select ids for bulk delete
Caused by: org.hibernate.exception.SQLGrammarException: could not insert/select ids for bulk delete
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
...
Caused by: java.sql.SQLException: #tbl_party_relationship not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output).
...
|