roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r1070259 - /roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
Date Sun, 13 Feb 2011 16:23:27 GMT
Author: snoopdave
Date: Sun Feb 13 16:23:27 2011
New Revision: 1070259

URL: http://svn.apache.org/viewvc?rev=1070259&view=rev
Log:
The error below is occurring during Roller builds on Hudson, but I cannot reproduce it on
my machine.

Caused by: <openjpa-2.0.1-r422266:989424 fatal general error> org.apache.openjpa.persistence.PersistenceException:
INSERT on table 'ROLLER_MEDIAFILETAG' caused a violation of foreign key constraint 'ROLLER_MEDIAFILE_ID_TAG_FK'
for key (e1504639-6322-4d10-803c-be5a673822d1).  The statement has been rolled back. {prepstmnt
23935034 INSERT INTO roller_mediafiletag (id, name, mediafile_id) VALUES (?, ?, ?) [params=?,
?, ?]} [code=-1, state=23503]

The fix in this commit ensures that both sides of the the MediaFile - MediaFileTag relationship
are maintained; it's the right thing to do regardless.

Modified:
    roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java

Modified: roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java?rev=1070259&r1=1070258&r2=1070259&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
(original)
+++ roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
Sun Feb 13 16:23:27 2011
@@ -1,5 +1,5 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
+   * Licensed to the Apache Software Foundation (ASF) under one or more
  *  contributor license agreements.  The ASF licenses this file to You
  * under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License.
@@ -448,6 +448,7 @@ public class MediaFileTest extends TestC
             rootDirectory.getMediaFiles().add(mf);
 
             MediaFileTag tag = new MediaFileTag("work", mf);
+            tag.setMediaFile(mf);
             Set<MediaFileTag> tags = new HashSet<MediaFileTag>();
             tags.add(tag);
             mf.setTags(tags);



Mime
View raw message