[hibernate-issues] [Hibernate-JIRA] Created: (HSEARCH-462) Indexes are not getting updated when entity gets updated via hql.

shareef shaik (JIRA) noreply at atlassian.com
Thu Feb 25 07:49:47 EST 2010


Indexes are not getting updated when entity gets updated via hql.
-----------------------------------------------------------------

                 Key: HSEARCH-462
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-462
             Project: Hibernate Search
          Issue Type: Bug
    Affects Versions: 3.1.1.GA
         Environment: Hibernate 3.3, H-Search 3.1.1 GA, Hiberante Annotations, Oracle DB, FSDirectoryProvider
            Reporter: shareef shaik


We are using Hibernate Annotations and Hibernate Search, and to my understanding there is no need to write listeners to update/delete index on update/delete of an entity. I tried updating an entity via hql update, and also via persisting the entity and making changes in it. In the second scenario, the index is getting updated, but in the first scenario it is not. I checked for the changes in db and in both scenarios, the changes are reflected in db. A simple test case for the same.

Case 1:
--------
String hql = "update UserMaster umst set umst.userName = :uName where umst.userId = :uId";
org.hibernate.Query query = getSession().createQuery(hql);
query.setParameter("uName","ABM1");
query.setParameter("uId",1001L);
query.executeUpdate();

Case 2:
--------
UserMaster master = (UserMaster)getSession().get(UserMaster.class,1001L);
master.setUserName("ABM1");

-- 
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