| .. | .. |
|---|
| 55 | 55 | @Inject |
|---|
| 56 | 56 | private EntityManagerProvider emProvider; |
|---|
| 57 | 57 | |
|---|
| 58 | + @Override |
|---|
| 58 | 59 | public void filter(ContainerRequestContext containerRequestContext) throws IOException { |
|---|
| 59 | 60 | EntityManager em = emProvider.getEntityManager(); |
|---|
| 60 | 61 | ResteasyProviderFactory.pushContext(EntityManager.class, em); |
|---|
| .. | .. |
|---|
| 63 | 64 | .getProperty("org.jboss.resteasy.core.ResourceMethodInvoker"); |
|---|
| 64 | 65 | Method method = methodInvoker.getMethod(); |
|---|
| 65 | 66 | |
|---|
| 66 | | - LOG.info("Stored in context, em: {}, {}?", em, method.toGenericString()); |
|---|
| 67 | + LOG.debug("Stored in context, em: {}, {}", em, method.toGenericString()); |
|---|
| 67 | 68 | |
|---|
| 68 | 69 | boolean next = checkSecurableMethods(containerRequestContext, method); |
|---|
| 69 | 70 | if (next) { |
|---|
| .. | .. |
|---|
| 75 | 76 | EntityManager em = ResteasyProviderFactory.getContextData(EntityManager.class); |
|---|
| 76 | 77 | |
|---|
| 77 | 78 | if (method.isAnnotationPresent(EnsureTransaction.class)) { |
|---|
| 78 | | - LOG.info("WE need transaction!!!"); |
|---|
| 79 | + LOG.debug("Beginning a new transaction"); |
|---|
| 79 | 80 | em.getTransaction().begin(); |
|---|
| 80 | 81 | } |
|---|
| 81 | 82 | } |
|---|
| .. | .. |
|---|
| 158 | 159 | EntityManager em = ResteasyProviderFactory.getContextData(EntityManager.class); |
|---|
| 159 | 160 | |
|---|
| 160 | 161 | if (em != null && em.getTransaction().isActive()) { |
|---|
| 161 | | - LOG.info("There is transaction go ahead..."); |
|---|
| 162 | + LOG.debug("Transaction is active, ready to finish it"); |
|---|
| 162 | 163 | if (responseContext.getStatus() == Status.OK.getStatusCode()) { |
|---|
| 163 | 164 | em.getTransaction().commit(); |
|---|
| 164 | | - LOG.info("COMMIT"); |
|---|
| 165 | + LOG.debug("COMMIT"); |
|---|
| 165 | 166 | } else { |
|---|
| 166 | 167 | em.getTransaction().rollback(); |
|---|
| 167 | | - LOG.info("ROLLBACK"); |
|---|
| 168 | + LOG.debug("ROLLBACK"); |
|---|
| 168 | 169 | } |
|---|
| 169 | | - } else { |
|---|
| 170 | | - LOG.info("There is NO transaction"); |
|---|
| 171 | | - |
|---|
| 172 | 170 | } |
|---|
| 173 | 171 | } |
|---|
| 174 | 172 | |
|---|