Stefan Woehrer wrote: > Hi, > > we are running XWiki 1.7.1 on Tomcat 6 with MS-SQL. > > When deleting attachments, in general, everything works fine. But on some > files we get a hibernate exception. We can't figure out why this error > appers with some attachments. Here's the exception: >
When deleting attachments, they are not completely removed, but are placed in a "recycle bin" table. Each row in this table has an ID column, which is a primary key. We use Hibernate to abstract the mapping between java objects and relational databases. This mapping is configured in an XML file, which, if you followed the installation instructions for MS SQL, is xwiki.mssql.hbm.xml. In this mapping file, we say that the ID should be generated by the database using its native key generator. In theory, everything should be fine. We haven't detected any problems so far, so there's probably something wrong in the configuration. Check that you followed the instructions on http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationMSSQL Make sure that: - you configured the right connector (should be OK since everything else works) - you use the right mapping file - try to edit the mapping file and replace the generator from native to identity (in the DeletedAttachment section) If this doesn't solve the problem, could you specify some more details? - what version of mssql are you using? - what version of the connector are you using? - is there something special about those attachments? Like longer names, or big size? - can the attachments be deleted if you try again? If nothing solves the problem, and you prefer to be able to delete all attachments than to be able to restore them, you could disable the attachment recycle bin, by editing xwiki.cfg and specifying: storage.attachment.recyclebin=0 -- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
