Re: MDB DependsOn not working?

2015-03-10 Thread Thiago Veronezi
Oh I see... maybe something inside the dao wasn't initialized/injected? []s, Thiago. On Tue, Mar 10, 2015 at 6:15 AM, Matej gma...@gmail.com wrote: UniversalConfigurationDao is a Stateless Bean. BRM 2015-03-10 10:51 GMT+01:00 Thiago Veronezi thi...@veronezi.org: Hi, Adding

Re: MDB DependsOn not working?

2015-03-10 Thread Thiago Veronezi
Hi, Adding @DependsOn(UniversalConfigurationDao) in your singleton bean does not fix the problem? @Singleton @Startup @ConcurrencyManagement(ConcurrencyManagementType.BEAN) @DependsOn(UniversalConfigurationDao) public class UniversalConfigurationService { @Inject

Re: MDB DependsOn not working?

2015-03-10 Thread Romain Manni-Bucau
Write a singleton MdbDelegate which has a onMessage methid and your mdb get MdbDelegate injected and mdb onMessage calls delegate.onMessage. This way you get depends on working. Le 10 mars 2015 11:55, Thiago Veronezi thi...@veronezi.org a écrit : Oh I see... maybe something inside the dao

Re: MDB DependsOn not working?

2015-03-10 Thread Matej
Hi Romain. I don't really understand your solution. Can you please provide me with simple exmaple So I'll understand. BR MAtej 2015-03-09 22:59 GMT+01:00 Romain Manni-Bucau rmannibu...@gmail.com: Why not using a dependson singleton as delegate in your mdb as mentionned? Fast and

Re: MDB DependsOn not working?

2015-03-09 Thread Matej
Would something like that help. That's probably something what David meant. @Singleton @Startup @Lock(LockType.READ) @ConcurrencyManagement(ConcurrencyManagementType.CONTAINER) public class UniversalConfigurationService { @Inject UniversalConfigurationDao configDao; private

Re: MDB DependsOn not working?

2015-03-09 Thread Romain Manni-Bucau
Why not using a dependson singleton as delegate in your mdb as mentionned? Fast and reliable as fix imo Le 9 mars 2015 22:13, Matej gma...@gmail.com a écrit : Would something like that help. That's probably something what David meant. @Singleton @Startup @Lock(LockType.READ)

Re: MDB DependsOn not working?

2015-03-07 Thread Matej
Hi Romain. Yes we have also @Startup annoatation. BR MAtej 2015-03-07 13:57 GMT+01:00 Romain Manni-Bucau rmannibu...@gmail.com: Hi Concurrency should be fine. Is singleton @Startup? Le 7 mars 2015 12:53, Matej gma...@gmail.com a écrit : Hi everybody. We have an annoying problem on

Re: MDB DependsOn not working?

2015-03-07 Thread Romain Manni-Bucau
Hi Concurrency should be fine. Is singleton @Startup? Le 7 mars 2015 12:53, Matej gma...@gmail.com a écrit : Hi everybody. We have an annoying problem on our production system. We have an Configuration Singleton which reads config things from DB. Then in one MDB we inject this Singleton to

MDB DependsOn not working?

2015-03-07 Thread Matej
Hi everybody. We have an annoying problem on our production system. We have an Configuration Singleton which reads config things from DB. Then in one MDB we inject this Singleton to control operation based on configs. Our problem is that the system is quite heavely loadded and while the system

Re: MDB DependsOn not working?

2015-03-07 Thread Romain Manni-Bucau
You should be able to delegate to another singleton in your mdb. Dependson would work then Le 7 mars 2015 20:31, Matej gma...@gmail.com a écrit : Hi Romain. Yes we have also @Startup annoatation. BR MAtej 2015-03-07 13:57 GMT+01:00 Romain Manni-Bucau rmannibu...@gmail.com: Hi

Re: MDB DependsOn not working?

2015-03-07 Thread David Blevins
The @DependsOn annotation only works for other @Singleton beans. Definitely use CONTAINER concurrency. Understand that this code is just a plain jvm ReentrantReadWriteLock under the covers. It would be hard to do much better. -