| .. | .. |
|---|
| 9 | 9 | import javax.inject.Inject; |
|---|
| 10 | 10 | import javax.persistence.EntityManager; |
|---|
| 11 | 11 | import javax.persistence.TypedQuery; |
|---|
| 12 | | -import javax.transaction.Transactional; |
|---|
| 13 | 12 | import javax.ws.rs.Consumes; |
|---|
| 14 | 13 | import javax.ws.rs.DELETE; |
|---|
| 15 | 14 | import javax.ws.rs.DefaultValue; |
|---|
| .. | .. |
|---|
| 41 | 40 | import net.curisit.securis.db.Pack; |
|---|
| 42 | 41 | import net.curisit.securis.db.PackStatus; |
|---|
| 43 | 42 | import net.curisit.securis.db.User; |
|---|
| 43 | +import net.curisit.securis.ioc.EnsureTransaction; |
|---|
| 44 | 44 | import net.curisit.securis.security.BasicSecurityContext; |
|---|
| 45 | 45 | import net.curisit.securis.security.Securable; |
|---|
| 46 | 46 | import net.curisit.securis.services.exception.SeCurisServiceException; |
|---|
| .. | .. |
|---|
| 81 | 81 | @Inject |
|---|
| 82 | 82 | private LicenseHelper licenseHelper; |
|---|
| 83 | 83 | |
|---|
| 84 | | - @Inject |
|---|
| 84 | + @Context |
|---|
| 85 | 85 | EntityManager em; |
|---|
| 86 | 86 | |
|---|
| 87 | 87 | @Inject |
|---|
| .. | .. |
|---|
| 152 | 152 | @Produces({ |
|---|
| 153 | 153 | MediaType.APPLICATION_OCTET_STREAM |
|---|
| 154 | 154 | }) |
|---|
| 155 | | - @Transactional |
|---|
| 155 | + @EnsureTransaction |
|---|
| 156 | 156 | public Response download(@PathParam("licId") Integer licId, @Context BasicSecurityContext bsc) throws SeCurisServiceException { |
|---|
| 157 | 157 | |
|---|
| 158 | 158 | // EntityManager em = emProvider.get(); |
|---|
| .. | .. |
|---|
| 185 | 185 | @POST |
|---|
| 186 | 186 | @Path("/{licId}/activate") |
|---|
| 187 | 187 | @Securable |
|---|
| 188 | | - @Transactional |
|---|
| 188 | + @EnsureTransaction |
|---|
| 189 | 189 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 190 | 190 | @Produces({ |
|---|
| 191 | 191 | MediaType.APPLICATION_JSON |
|---|
| .. | .. |
|---|
| 233 | 233 | @POST |
|---|
| 234 | 234 | @Path("/{licId}/send") |
|---|
| 235 | 235 | @Securable |
|---|
| 236 | | - @Transactional |
|---|
| 236 | + @EnsureTransaction |
|---|
| 237 | 237 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 238 | 238 | @Produces({ |
|---|
| 239 | 239 | MediaType.APPLICATION_JSON |
|---|
| .. | .. |
|---|
| 289 | 289 | @POST |
|---|
| 290 | 290 | @Path("/{licId}/cancel") |
|---|
| 291 | 291 | @Securable |
|---|
| 292 | | - @Transactional |
|---|
| 292 | + @EnsureTransaction |
|---|
| 293 | 293 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 294 | 294 | @Produces({ |
|---|
| 295 | 295 | MediaType.APPLICATION_JSON |
|---|
| .. | .. |
|---|
| 340 | 340 | @Produces({ |
|---|
| 341 | 341 | MediaType.APPLICATION_JSON |
|---|
| 342 | 342 | }) |
|---|
| 343 | | - @Transactional |
|---|
| 343 | + @EnsureTransaction |
|---|
| 344 | 344 | public Response create(License lic, @Context BasicSecurityContext bsc) throws SeCurisServiceException { |
|---|
| 345 | 345 | // EntityManager em = emProvider.get(); |
|---|
| 346 | 346 | |
|---|
| .. | .. |
|---|
| 462 | 462 | @POST |
|---|
| 463 | 463 | @Path("/{licId}") |
|---|
| 464 | 464 | @Securable |
|---|
| 465 | | - @Transactional |
|---|
| 465 | + @EnsureTransaction |
|---|
| 466 | 466 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 467 | 467 | @Produces({ |
|---|
| 468 | 468 | MediaType.APPLICATION_JSON |
|---|
| .. | .. |
|---|
| 509 | 509 | |
|---|
| 510 | 510 | @DELETE |
|---|
| 511 | 511 | @Path("/{licId}") |
|---|
| 512 | | - @Transactional |
|---|
| 512 | + @EnsureTransaction |
|---|
| 513 | 513 | @Securable |
|---|
| 514 | 514 | @Produces({ |
|---|
| 515 | 515 | MediaType.APPLICATION_JSON |
|---|
| .. | .. |
|---|
| 541 | 541 | |
|---|
| 542 | 542 | @POST |
|---|
| 543 | 543 | @Path("/{licId}/block") |
|---|
| 544 | | - @Transactional |
|---|
| 544 | + @EnsureTransaction |
|---|
| 545 | 545 | @Securable |
|---|
| 546 | 546 | @Produces({ |
|---|
| 547 | 547 | MediaType.APPLICATION_JSON |
|---|
| .. | .. |
|---|
| 574 | 574 | |
|---|
| 575 | 575 | @POST |
|---|
| 576 | 576 | @Path("/{licId}/unblock") |
|---|
| 577 | | - @Transactional |
|---|
| 577 | + @EnsureTransaction |
|---|
| 578 | 578 | @Securable |
|---|
| 579 | 579 | @Produces({ |
|---|
| 580 | 580 | MediaType.APPLICATION_JSON |
|---|