Skip to content

Commit

Permalink
added @InjectedSession and @scope(prototype) to FedoraTransactions fo…
Browse files Browse the repository at this point in the history
…r Session injection
  • Loading branch information
fasseg committed Jun 13, 2013
1 parent 90f0eda commit 2c768c9
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -19,21 +19,26 @@
import org.fcrepo.AbstractResource;
import org.fcrepo.Transaction;
import org.fcrepo.services.TransactionService;
import org.fcrepo.session.InjectedSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("prototype")
@Path("/fcr:tx")
public class FedoraTransactions extends AbstractResource {

@Autowired
private TransactionService txService;

@InjectedSession
protected Session session;

@POST
@Produces({ APPLICATION_JSON, TEXT_XML })
public Transaction createTransaction() throws RepositoryException {
Session sess = getAuthenticatedSession();
return txService.beginTransaction(sess);
return txService.beginTransaction(session);
}

@GET
Expand Down

0 comments on commit 2c768c9

Please sign in to comment.