container-managed

Protected URLs leaking unprotected components of the webapge to unauthenticated users

只谈情不闲聊 提交于 2019-12-18 13:42:56
问题 I believe implementing security for a JSF application through <login-config> + <security-constraint> + <security-role> & through use of <filter> are two different ways !? Are they ? I tried implementing security through the first method above(using <login-config> + <security-constraint> + <security-role> ) but found that my protected webpage that was using both protected & unprotected HTML components was delivered with unprotected resources even to the unauthenticated users. I need to protect

How do i catch exceptions from container managed transaction commit?

泄露秘密 提交于 2019-12-06 03:17:53
问题 I have a @Stateless EJB with a @WebService interface, using container managed transactions, meaning transactions are automatically committed by the container after a method has been called if it doesn't throw a system exception. If i try to EntityManager.persist(...) two objects with the same value for a column with a unique constraint on it, the container will throw a PersistenceException to the client on commit outside my code. How do i catch this exception so i can rethrow my own

Container Managed Transactions can not rollback

主宰稳场 提交于 2019-12-04 15:49:15
I am playing arround with transactions. I configured JPA to handle my Entitys, and want to persist them in the database. The problem is, CMT will not rollback, when my program throws an runtimeException. The idea behind this "container thing" is so hard to understand and so poorly documented. @transactional managed transactions, pure CDI Interceptor managed transactions and Bean Managed transactions are working like a charm. Here is what I coded: This is a simple "Cinema-Demonstration". you want to see two Movies with X seats. The Seats are limited. If there are not enough seats in Films,

How do i catch exceptions from container managed transaction commit?

亡梦爱人 提交于 2019-12-04 07:28:25
I have a @Stateless EJB with a @WebService interface, using container managed transactions, meaning transactions are automatically committed by the container after a method has been called if it doesn't throw a system exception. If i try to EntityManager.persist(...) two objects with the same value for a column with a unique constraint on it, the container will throw a PersistenceException to the client on commit outside my code. How do i catch this exception so i can rethrow my own application exception? Do i have to commit the transaction manually in my methods to catch exceptions on commit?

Protected URLs leaking unprotected components of the webapge to unauthenticated users

我与影子孤独终老i 提交于 2019-11-30 10:30:10
I believe implementing security for a JSF application through <login-config> + <security-constraint> + <security-role> & through use of <filter> are two different ways !? Are they ? I tried implementing security through the first method above(using <login-config> + <security-constraint> + <security-role> ) but found that my protected webpage that was using both protected & unprotected HTML components was delivered with unprotected resources even to the unauthenticated users. I need to protect the URLs completely so that the protected URLs don't even leak any part of that webpage to the

When does @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) commit?

我是研究僧i 提交于 2019-11-29 22:17:58
An EJB method named Aby calls another EJB method named Bob Bob is marked with @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) When does bob transaction commits?: a) when bob invocation ends b) when aby invocation ends c) other. when? Petr Mensik I think A is right. When the method Bob is being called, it creates new transaction for it and method Aby gets suspended until the Bob transaction is committed. Also note that it has to be method from some other bean to make it transactional, methods called from the same bean do not act as a business methods. See this great article for

When does @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) commit?

为君一笑 提交于 2019-11-28 18:56:23
问题 An EJB method named Aby calls another EJB method named Bob Bob is marked with @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) When does bob transaction commits?: a) when bob invocation ends b) when aby invocation ends c) other. when? 回答1: I think A is right. When the method Bob is being called, it creates new transaction for it and method Aby gets suspended until the Bob transaction is committed. Also note that it has to be method from some other bean to make it transactional,