Posts Tagged 'e-commerce'

WebSphere Commerce Hint: Content Managed Files

The CMFILE table in WebSphere Commerce 6.0 is used to store managed files along with associated meta data. Recently I ran into a situation where I deleted an Attachment from the file system by redeploying the Stores.war module instead of just doing a partial update. When the ScheduledContentManagedFileEARUpdate scheduled job ran I expected to see the file appear in the Attachments folder in the deployed Stores.war file but instead nothing happened.

After doing some research, I found that there are two columns in the CMFILE table that need to be updated to ensure a content managed file is updated when the scheduled job runs. The PROMOTE_FS column indicates if a file has been created on the file system, a 0 value indicates that the file has not been promoted while a 1 value indicates that it has been promoted. The PROMOTE_TIMESTAMP column records the date that the file was created on the file system initially. I used the following SQL update in order to tell the scheduled job to recreate the file.

sql>update CMFILE set PROMOTE_FS = 0, PROMOTE_TIMESTAMP = NULL where CMFILEPATH = ‘path/to/file’;

Sure enough the next time the job ran the file appeared in the Stores.war/StoreName folder in the Attachment directory.

Click here to learn more about managed files.