Page 1 of 1

catalog SQL updates not reflecting on UI

Posted: Mon Nov 26, 2012 9:46 am
by pranjal
I am using 2.0.1 GA version.

Updates that I have made to the SQL scripts (like new insert statements in load_catalog_data.sql) are not getting inserted in the database and are not reflecting on UI. So far, I haven't made any changes to the Demo site apart from changes in insert statements in SQL scripts in core. I have tried the following options but havent had any luck so far:
- Migrated from HSQL to MySQL
- Clearing query cache
- Tried setting hibernate.hbm2ddl.auto parameter to create, create-drop and update.

None of the above options ran the updated Insert statements and after each rebuild, heat clinic data is being populated on the UI as well as in the DB.

I also noticed that if I rename the SQL script and update the same file name in development.properties (hibernate.hbm2ddl.import_files), the SQL script is not picked up (confirmed by setting Hibernate log setting to INFO)

Please let me know if this is not the correct way to make updates thru SQL scripts in core.

Re: catalog SQL updates not reflecting on UI

Posted: Mon Nov 26, 2012 10:35 am
by phillipuniverse
Try dropping your database and restarting with the ddl set to 'create-drop'. Also, the only time your import scripts will run is if you have the ddl set to 'create' or 'create-drop'. 'create-drop' will create the database (meaning it will run CREATE TABLE statements) on startup as well as run your import scripts, but then drop the database when you stop the server. If you start up twice in a row with the ddl set to just 'create' you will probably have errors.

If you want to persist your data between restarts, I would recommend starting up the server with 'create' on first run, then change the ddl to 'update'. This will ensure that additional restarts won't try to re-import your data.

I would also make sure that the file that you are modifying is actually the same file being referenced in core development.properties.

Re: catalog SQL updates not reflecting on UI

Posted: Mon Nov 26, 2012 11:12 am
by pranjal
Thanks for your reply.
Yes, the file I am modifying is actually the same referenced in core development.properties

I have tried create and create-drop both. However I am not getting any error at both, the problem is the changes which I made in SQL script to insert new data is not reflecting.
For Example:

If I update some lines in load_catalog_data.sql as below:

INSERT INTO BLC_CATEGORY (CATEGORY_ID,DESCRIPTION,NAME,URL,DEFAULT_PARENT_CATEGORY_ID,ACTIVE_START_DATE) VALUES (2002,'XYZ','XYZ','/XYZ',2,CURRENT_TIMESTAMP);

The new row corresponding XYZ does not get reflected in BLC_Category table.