Changeset 7478
- Timestamp:
- Apr 16, 2018, 9:03:52 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3.12-stable merged: 7468,7473-7475 /tags/3.12.2 (added) merged: 7476
- Property svn:mergeinfo changed
-
trunk/src/core/net/sf/basedb/core/hibernate/NativeQueryWrapper.java
r7469 r7478 522 522 with a shorter list, Hibernate will try to set the non-existing parameters 523 523 which causes an exception. See http://base.thep.lu.se/ticket/2110 524 UPDATE: We also need to check for copied parameter (name) in case the list 525 contained only a single element. See http://base.thep.lu.se/ticket/2113 524 526 */ 525 527 @SuppressWarnings({ "unchecked", "rawtypes" }) … … 540 542 { 541 543 String name = i.next().getName(); 542 if (name.startsWith(prefixOfParametersToRemove) )544 if (name.startsWith(prefixOfParametersToRemove) || name.equals(parameterName)) 543 545 { 544 546 i.remove(); -
trunk/src/plugins/core/net/sf/basedb/plugins/AnnotationFlatFileImporter.java
r7204 r7478 643 643 private int numRemoved; 644 644 private ProgressReporter progress; 645 // Percentages will be adjusted based on number of annotations 646 private int progressParser = 50; // Progress percentage for file-parsing 647 private int progressDatabase = 48; // Progress percentage for database update 645 648 646 649 @Override … … 761 764 ++i; 762 765 } 766 767 // Recalculate progress parts so that the file parsing is between 10-50% depedning on number of annotations 768 int dbPart = (1 + mappers.size() % 20); 769 progressParser = Math.max(100 / (1+dbPart), 10); 770 progressDatabase = 98 - progressParser; 771 763 772 batcher = new AnnotationBatcher(dc, itemType); 764 773 batcher.addAnnotationTypes(mappers.values()); … … 948 957 for (Set<NewAnnotations> n : itemCache.values()) 949 958 { 950 if (progress != null && current % 100 == 0) 951 { 952 progress.display(50 + (48 * current) / total, "Saving to database (" + current + " of " + total + " items done)..."); 959 // progressParser should be between 10-50 and is a good interval for progress reporting 960 if (progress != null && current % progressParser == 0) 961 { 962 progress.display(progressParser + (progressDatabase * current) / total, "Saving to database (" + current + " of " + total + " items done)..."); 953 963 } 954 964 current++; … … 996 1006 /** 997 1007 Overriding default implementation since we want file parsing to 998 only use 50% and the remaining 50% for storing to the database. 1008 only use 'progressParser'% and the remaining 'progressDatabase'% 1009 for storing to the database. 999 1010 */ 1000 1011 @Override 1001 1012 protected int getProgress(FlatFileParser ffp) 1002 1013 { 1003 return super.getProgress(ffp) * 50 / 100; 1014 if (ffp.getParsedDataLines() == 0) return 0; 1015 return super.getProgress(ffp) * progressParser / 100; 1004 1016 } 1005 1017 // -------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.