Wow this is an old thread.. I think I ended up using Jersey's built-in logging filter configured in web.xml since logging is the only reason I needed AOP.
The only thing we used the Spring...
Type: Posts; User: rdelaplante; Keyword(s):
Wow this is an old thread.. I think I ended up using Jersey's built-in logging filter configured in web.xml since logging is the only reason I needed AOP.
The only thing we used the Spring...
I remember something else. If you want to use JTA, then the DataSource must come from the application server via JNDI. JTA cannot use a DataSource configured by Spring.
I think I ended up finding some truth about this statement, but don't remember the details:
Combing through the Spring Reference and JavaDocs led me to believe that there are known issues...
I am now looking into Jersey specific filters:
https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/package-summary.html
Hi,
I have a JAX-RS resource that uses Jersey's own @Inject annotation to inject a transactional Spring service bean. Injection works, and the service works.
I want to create an aspect for...
I was not able to figure out how to make it work from @PreDestroy but I did find an alternate solution. I want to record a transaction in the database containing session data when the session...
Hi,
I have a session scope class in a web app that has a @PreDestroy annotation on a destroy() method. This method calls a service layer object that is annotated with @Transactional. The service...
Hi,
I've created a class annotated with @Transactional, and a bunch of JPA DAO's are injected into the constructor. The DAO's use @PersistenceContext to get access to the EntityManager.
When...
Yes it already has that. Transactions work fine everywhere, but now that I want to change the propagation of a particular DAO that is being called from a service class that has already started a...
I have a service layer class that uses two DAO classes, each configured for a different JPA persistence unit/database. The service does reads on both, but only writes to one of them. The...
Did it solve your problem?
This may not answer your question, but you may find it helpful.
In my experience, it is best to delegate everything to GlassFish. This requires minimal Spring xml configuration, no load time...
Thanks for the reply, but I just finished saying that I was using the Spring container to bootstrap the persistence unit using @PersistenceContext(unitName="blah") until I had to add a second...
I must have made a typo in the forum but I'm pretty certain I have always specified unitName="whatever" when using @PersistenceContext and @PersistenceUnit. Further up in this thread I mentioned my...
I'll describe the latest news. Earlier I mentioned that the web app running in GlassFish works when I don't use @PersitenceContext or @PersistenceUnit. Instead I use spring XML to inject the right...
It looks like I'm going to have to separate the settings for each datasource/entitymanager/transaction manager into separate XML configuration files, and only load the one I need for the particular...
Next I moved onto my unit test environment and have more problems. My unit test environment does not use JTA or JNDI data sources. It has two datasources defined in the applicationContext.xml, and...
I recently battled Spring with this problem and found a way to make it work:
http://forum.springframework.org/showthread.php?t=60729
Note that I don't mention a datasource in...
I have found a hack to make this work. I call it a hack because Spring 2.5 does not properly implement support for JPA and therefore I have to do extra work to support multiple persistence units. ...
I've seen some threads talk about using a DefaultPersistenceUnitManager and sharing them between all LocalContainerEntityManagerFactoryBean instances. I still get the same problem where...
Hi,
I have spent all day reading forums, blogs and documentation on this topic without any luck. What I want to do is:
- I have a PostgreSQL database and an SQL Server database
- I have two...
Awesome, thank you!
Oh geeze, now I see onSetUp and onTearDown. There doesn't seem to be a way to delete this thread from the forums. Sorry :/
Anyway, still looking for a way to get Connection object from...
Hi,
I am using AbstractJpaTests to test a DAO. I'm also using DbUnit to insert test data. To initialize DbUnit I'm using the DataSource provided by getJdbcTemplate().getDataSource(), so DbUnit...
Thanks so much for the reply. I wanted to use some of JUnit 4's more advanced features that help keep my test cases very short. Oh well, I've already wasted too much time trying to figure this out...