Project

General

Profile

« Previous | Next » 

Revision 7759e4de

Added by Andreas Müller almost 8 years ago

LockMode issues in transient services

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteTaxonOperation.java
15 15
import eu.etaxonomy.cdm.api.service.DeleteResult;
16 16
import eu.etaxonomy.cdm.api.service.ITaxonService;
17 17
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
18
import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
19 18
import eu.etaxonomy.cdm.model.taxon.Classification;
20 19
import eu.etaxonomy.cdm.model.taxon.Taxon;
21 20
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientAgentService.java
15 15
import java.util.Set;
16 16
import java.util.UUID;
17 17

  
18
import org.hibernate.LockMode;
18
import org.hibernate.LockOptions;
19 19
import org.hibernate.Session;
20 20
import org.hibernate.criterion.Criterion;
21 21
import org.hibernate.envers.query.criteria.AuditCriterion;
......
132 132
     * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
133 133
     */
134 134
    @Override
135
    public void lock(AgentBase t, LockMode lockMode) {
136
        defaultAgentService.lock(t, lockMode);
135
    public void lock(AgentBase t, LockOptions lockOptions) {
136
        defaultAgentService.lock(t, lockOptions);
137 137
    }
138 138

  
139 139
    /**
......
143 143
     * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
144 144
     */
145 145
    @Override
146
    public void refresh(AgentBase t, LockMode lockMode, List<String> propertyPaths) {
147
        defaultAgentService.refresh(t, lockMode, propertyPaths);
146
    public void refresh(AgentBase t, LockOptions lockOptions, List<String> propertyPaths) {
147
        defaultAgentService.refresh(t, lockOptions, propertyPaths);
148 148
    }
149 149

  
150 150
    /**
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientClassificationService.java
15 15
import java.util.Set;
16 16
import java.util.UUID;
17 17

  
18
import org.hibernate.LockMode;
18
import org.hibernate.LockOptions;
19 19
import org.hibernate.Session;
20 20
import org.hibernate.criterion.Criterion;
21 21
import org.hibernate.envers.query.criteria.AuditCriterion;
......
143 143
     * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
144 144
     */
145 145
    @Override
146
    public void lock(Classification t, LockMode lockMode) {
147
        defaultClassificationService.lock(t, lockMode);
146
    public void lock(Classification t, LockOptions lockOptions) {
147
        defaultClassificationService.lock(t, lockOptions);
148 148
    }
149 149

  
150 150
    /**
......
154 154
     * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
155 155
     */
156 156
    @Override
157
    public void refresh(Classification t, LockMode lockMode, List<String> propertyPaths) {
158
        defaultClassificationService.refresh(t, lockMode, propertyPaths);
157
    public void refresh(Classification t, LockOptions lockOptions, List<String> propertyPaths) {
158
        defaultClassificationService.refresh(t, lockOptions, propertyPaths);
159 159
    }
160 160

  
161 161
    /**
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientDescriptionService.java
15 15
import java.util.Set;
16 16
import java.util.UUID;
17 17

  
18
import org.hibernate.LockMode;
18
import org.hibernate.LockOptions;
19 19
import org.hibernate.Session;
20 20
import org.hibernate.criterion.Criterion;
21 21
import org.hibernate.envers.query.criteria.AuditCriterion;
......
120 120
     * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
121 121
     */
122 122
    @Override
123
    public void lock(DescriptionBase t, LockMode lockMode) {
124
        defaultDescriptionService.lock(t, lockMode);
123
    public void lock(DescriptionBase t, LockOptions lockOptions) {
124
        defaultDescriptionService.lock(t, lockOptions);
125 125
    }
126 126

  
127 127
    /**
......
131 131
     * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
132 132
     */
133 133
    @Override
134
    public void refresh(DescriptionBase t, LockMode lockMode, List<String> propertyPaths) {
135
        defaultDescriptionService.refresh(t, lockMode, propertyPaths);
134
    public void refresh(DescriptionBase t, LockOptions lockOptions, List<String> propertyPaths) {
135
        defaultDescriptionService.refresh(t, lockOptions, propertyPaths);
136 136
    }
137 137

  
138 138
    /**
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientNameService.java
18 18

  
19 19
import org.apache.lucene.index.CorruptIndexException;
20 20
import org.apache.lucene.queryParser.ParseException;
21
import org.hibernate.LockMode;
21
import org.hibernate.LockOptions;
22 22
import org.hibernate.Session;
23 23
import org.hibernate.criterion.Criterion;
24 24
import org.hibernate.envers.query.criteria.AuditCriterion;
......
131 131
     * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
132 132
     */
133 133
    @Override
134
    public void lock(TaxonNameBase t, LockMode lockMode) {
135
        defaultNameService.lock(t, lockMode);
134
    public void lock(TaxonNameBase t, LockOptions lockOptions) {
135
        defaultNameService.lock(t, lockOptions);
136 136
    }
137 137

  
138 138
    /**
......
142 142
     * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
143 143
     */
144 144
    @Override
145
    public void refresh(TaxonNameBase t, LockMode lockMode, List<String> propertyPaths) {
146
        defaultNameService.refresh(t, lockMode, propertyPaths);
145
    public void refresh(TaxonNameBase t, LockOptions lockOptions, List<String> propertyPaths) {
146
        defaultNameService.refresh(t, lockOptions, propertyPaths);
147 147
    }
148 148

  
149 149
    /**
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientOccurenceService.java
19 19

  
20 20
import org.apache.lucene.index.CorruptIndexException;
21 21
import org.apache.lucene.queryParser.ParseException;
22
import org.hibernate.LockMode;
22
import org.hibernate.LockOptions;
23 23
import org.hibernate.Session;
24 24
import org.hibernate.criterion.Criterion;
25 25
import org.hibernate.envers.query.criteria.AuditCriterion;
......
128 128
     * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
129 129
     */
130 130
    @Override
131
    public void lock(SpecimenOrObservationBase t, LockMode lockMode) {
132
        defaultService.lock(t, lockMode);
131
    public void lock(SpecimenOrObservationBase t, LockOptions lockOptions) {
132
        defaultService.lock(t, lockOptions);
133 133
    }
134 134

  
135 135
    /**
......
139 139
     * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
140 140
     */
141 141
    @Override
142
    public void refresh(SpecimenOrObservationBase t, LockMode lockMode, List<String> propertyPaths) {
143
        defaultService.refresh(t, lockMode, propertyPaths);
142
    public void refresh(SpecimenOrObservationBase t, LockOptions lockOptions, List<String> propertyPaths) {
143
        defaultService.refresh(t, lockOptions, propertyPaths);
144 144
    }
145 145

  
146 146
    /**
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientReferenceService.java
15 15
import java.util.Set;
16 16
import java.util.UUID;
17 17

  
18
import org.hibernate.LockMode;
18
import org.hibernate.LockOptions;
19 19
import org.hibernate.Session;
20 20
import org.hibernate.criterion.Criterion;
21 21
import org.hibernate.envers.query.criteria.AuditCriterion;
......
121 121
     * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
122 122
     */
123 123
    @Override
124
    public void lock(Reference t, LockMode lockMode) {
125
        defaultReferenceService.lock(t, lockMode);
124
    public void lock(Reference t, LockOptions lockOptions) {
125
        defaultReferenceService.lock(t, lockOptions);
126 126
    }
127 127

  
128 128
    /**
......
132 132
     * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
133 133
     */
134 134
    @Override
135
    public void refresh(Reference t, LockMode lockMode, List<String> propertyPaths) {
136
        defaultReferenceService.refresh(t, lockMode, propertyPaths);
135
    public void refresh(Reference t, LockOptions lockOptions, List<String> propertyPaths) {
136
        defaultReferenceService.refresh(t, lockOptions, propertyPaths);
137 137
    }
138 138

  
139 139
    /**
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientTaxonService.java
19 19

  
20 20
import org.apache.lucene.index.CorruptIndexException;
21 21
import org.apache.lucene.queryParser.ParseException;
22
import org.hibernate.LockMode;
22
import org.hibernate.LockOptions;
23 23
import org.hibernate.Session;
24 24
import org.hibernate.criterion.Criterion;
25 25
import org.hibernate.envers.query.criteria.AuditCriterion;
......
144 144
     * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
145 145
     */
146 146
    @Override
147
    public void lock(TaxonBase t, LockMode lockMode) {
148
        defaultTaxonService.lock(t, lockMode);
147
    public void lock(TaxonBase t, LockOptions lockOptions) {
148
        defaultTaxonService.lock(t, lockOptions);
149 149
    }
150 150

  
151 151
    /**
......
155 155
     * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
156 156
     */
157 157
    @Override
158
    public void refresh(TaxonBase t, LockMode lockMode, List<String> propertyPaths) {
159
        defaultTaxonService.refresh(t, lockMode, propertyPaths);
158
    public void refresh(TaxonBase t, LockOptions lockOptions, List<String> propertyPaths) {
159
        defaultTaxonService.refresh(t, lockOptions, propertyPaths);
160 160
    }
161 161

  
162 162
    /**
......
1343 1343
        return defaultTaxonService.createAllInferredSynonyms(taxon, tree, doWithMisappliedNames);
1344 1344
    }
1345 1345

  
1346
    /* (non-Javadoc)
1347
     * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator)
1348
     */
1349 1346
    @Override
1350 1347
    public DeleteResult deleteSynonym(Synonym arg0, SynonymDeletionConfigurator arg1) {
1351 1348
        return defaultTaxonService.deleteSynonym(arg0, arg1);
1352 1349
    }
1353 1350

  
1354
    /* (non-Javadoc)
1355
     * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator)
1356
     */
1357 1351
    @Override
1358 1352
    public DeleteResult deleteSynonym(Synonym arg0, Taxon arg1, SynonymDeletionConfigurator arg2) {
1359 1353
        return defaultTaxonService.deleteSynonym(arg0, arg1, arg2);
1360 1354
    }
1361 1355

  
1362
    /* (non-Javadoc)
1363
     * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator, eu.etaxonomy.cdm.model.taxon.Classification)
1364
     */
1365 1356
    @Override
1366 1357
    public DeleteResult deleteTaxon(Taxon arg0, TaxonDeletionConfigurator arg1, Classification arg2) {
1367 1358
        return defaultTaxonService.deleteTaxon(arg0, arg1, arg2);
1368 1359
    }
1369 1360

  
1370
    /* (non-Javadoc)
1371
     * @see eu.etaxonomy.cdm.api.service.ITaxonService#getSynonymsByHomotypicGroup(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.List)
1372
     */
1373 1361
    @Override
1374 1362
    public List<List<Synonym>> getSynonymsByHomotypicGroup(Taxon taxon, List<String> propertyPaths) {
1375 1363
        return defaultTaxonService.getSynonymsByHomotypicGroup(taxon, propertyPaths);
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientTermService.java
18 18
import java.util.Set;
19 19
import java.util.UUID;
20 20

  
21
import org.hibernate.LockMode;
21
import org.hibernate.LockOptions;
22 22
import org.hibernate.Session;
23 23
import org.hibernate.criterion.Criterion;
24 24
import org.hibernate.envers.query.criteria.AuditCriterion;
......
118 118
     * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
119 119
     */
120 120
    @Override
121
    public void lock(DefinedTermBase t, LockMode lockMode) {
122
        defaultTermService.lock(t, lockMode);
121
    public void lock(DefinedTermBase t, LockOptions lockOptions) {
122
        defaultTermService.lock(t, lockOptions);
123 123
    }
124 124

  
125 125
    /**
......
139 139
     * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
140 140
     */
141 141
    @Override
142
    public void refresh(DefinedTermBase t, LockMode lockMode, List<String> propertyPaths) {
143
        defaultTermService.refresh(t, lockMode, propertyPaths);
142
    public void refresh(DefinedTermBase t, LockOptions lockOptions, List<String> propertyPaths) {
143
        defaultTermService.refresh(t, lockOptions, propertyPaths);
144 144
    }
145 145

  
146 146
    /**
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/DeleteOperation.java
20 20
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
21 21
import eu.etaxonomy.cdm.api.service.DeleteResult;
22 22
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
23
import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
24 23
import eu.etaxonomy.cdm.model.description.PolytomousKey;
25 24
import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
26 25
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/DeleteOperation.java
27 27
import eu.etaxonomy.cdm.api.service.IClassificationService;
28 28
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
29 29
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
30
import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
31
import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
32 30
import eu.etaxonomy.cdm.model.common.CdmBase;
33 31
import eu.etaxonomy.cdm.model.taxon.Classification;
34 32
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
......
103 101
				//((TaxonNode) treeNode).delete();
104 102

  
105 103
				element = ((TaxonNode)taxonNode).getTaxon();
106
				
104

  
107 105
				DeleteResult result = service.deleteTaxonNode((TaxonNode)taxonNode, config);
108 106
				if (result.isError()){
109 107
					//TODO:Error message!

Also available in: Unified diff