Inside a container you never know if you have a single instance or multible ones and that makes it so dangerous. If you have a counter of something you need to be sure you have a single instance. If...
Type: Posts; User: haug; Keyword(s):
Inside a container you never know if you have a single instance or multible ones and that makes it so dangerous. If you have a counter of something you need to be sure you have a single instance. If...
Which is a good thing for server applications, because you can create real singletons and avoid creating the whole object tree with every new transaction.
Except for the trivial application...
If you use dependency injection (Spring beans) how would you like to solve the issue that a persistent object lives only as long as the transaction lives?
If you create a Spring bean and it...
That's easy, Spring creates it's objects without beeing part of any transaction. Persistent objects are always part of a transaction and live only as long as the transaction lives. This is normally...
I wonder how others may solve the issue that an OR mapped object lives only as long as the transaction lives. If you create beans with Spring you can not have references to your persistent objects....
I have no ideas what happens there but experienced the same issue. If I use the following code the variables are resolved.
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();...