Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #81 from futures/tx-session-injection
added @InjectedSession and @scope(prototype) to FedoraTransactions
  • Loading branch information
ajs6f committed Jun 13, 2013
2 parents 002b086 + 2c768c9 commit b916f69
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 b916f69

Please sign in to comment.