Commit efdd516c authored by Gerrit Hübbers's avatar Gerrit Hübbers 🃏
Browse files

Change fetch type from EAGER to LAZY, as it is otherwise crippling performance...

Change fetch type from EAGER to LAZY, as it is otherwise crippling performance for big BundlesSources during org.gesis.dda.wizard.service.FeederService.createOrUpdateBundle(..) (see org.hibernate.SQL log on DEBUG level)
parent 6d9b2e67
package org.gesis.dda.wizard.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.gesis.dda.publishing.domain.Metadatum;
import org.gesis.dda.publishing.domain.impl.JpaMetadatum;
import org.gesis.dda.wizard.domain.enumeration.BundleState;
......@@ -9,12 +27,8 @@ import org.gesis.dda.wizard.service.BundleService;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
* A Bundle.
......@@ -45,7 +59,7 @@ public class Bundle implements Serializable, org.gesis.dda.publishing.domain.Bun
@Column(name = "last_harvesting_instant")
private Instant lastHarvestingInstant;
@ElementCollection(fetch = FetchType.EAGER)
@ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name="metadatum",
joinColumns=@JoinColumn(name="bundle_id")
)
......@@ -59,6 +73,7 @@ public class Bundle implements Serializable, org.gesis.dda.publishing.domain.Bun
this.id = id;
}
@Override
public String getReference() {
return reference;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment