[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3990) Bulk update statements do not use default schema in generated SQL

hard hat (JIRA) noreply at atlassian.com
Thu Jun 25 07:32:34 EDT 2009


Bulk update statements do not use default schema in generated SQL
-----------------------------------------------------------------

                 Key: HHH-3990
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3990
             Project: Hibernate Core
          Issue Type: Bug
    Affects Versions: 3.3.1
         Environment: Hibernate 3.3.1GA
Oracle 10g
            Reporter: hard hat
            Priority: Critical


When setting the hibernate.default_schema property in hibernate.cfg, the schema is not used when executing buld (hql) update statements. You can test this easily with any existing hibernate mapping + database:

Create a second database user, grant select & update rights for the tables in your existing database to that user. Modify your hibernate.cfg to use the new user and set the default schema to the new user. Now, your application should work just as before, except for any bulk updates. You can now try to make a bulk update, for exampe:

query = session.createQuery("update versioned Person p SET p.name = :name where p.id = :id");
query.setString("name", "Jack");
query.setLong("id", 42);
query.executeUpdate();

This fails with TABLE NOT EXIST error, because the generated SQL does not have the defined default schema as prefix.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list