Hi Pavla,
Please check the "persistenceXmlLocation" property below. If let commented out, it works, as Spring 2.5.6 will look for the default persistence.xml.
If uncommented, Spring/Something...
Type: Posts; User: Coder; Keyword(s):
Hi Pavla,
Please check the "persistenceXmlLocation" property below. If let commented out, it works, as Spring 2.5.6 will look for the default persistence.xml.
If uncommented, Spring/Something...
The problem is the persistenceXmlLocation property. It puts the persistence file in a different class loaded from the POJO themselves. This looks like a bug...
<bean id="bbsEntityManagerFactory"...
Hi all,
I tried to use Spring 2.5.6 along with Hibernate/JPA within a WebApp in Tomcat from Netbeans/maven. It would seem like the EntityManager cannot find my annotated class. It works when I...
I use the below spring 2.5.6 config for JPA/Hibernate. How do I change that to JPA/DataNucleus (using JPA, not JDO). I could not find a suitable adapter.
My classes are weaved with aspectJ at...
Either a snippet or an object graph reflecting the same...
Wouldn't it be nice to be able to pass in a snippet of "<beans></beans" at runtime to Spring and have Spring add it to its application context? :)
That would be cool...I think...
I am hesitating over the part where my "scope handler" instantiates the beans. Is there a way to delegate the "new" to Spring along with appropriate dependencies so Spring can wire up the objects?
...
Refining
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" scope="myScope">
<aop:scoped-proxy/>
</bean>
<bean id="entityManagerFactory"...
I am thinking that
1. Scoped proxy
2. AbstractRoutingDataSource
ought to do the trick. I can manipulate the AbstractRoutingDataSource at runtime to add/remove data sources.
One key issue...
So, the idea is that use custom scope in combination of some custom factory managing data sources. The custom factory can then be modified at runtime to manage additional or less data sources.
...
I have the following architecture requirements:
1. Use JPA (hibernate), Spring, AOP (compile-time weaving), and @Transactional
2. [Service Objects] <-> [Data Access Objects] <-> [Data Sources]...
I have two jpa units: basic-model and app-model
app-model has Entities extends Entities in basic-model
app-model also has Entities that have n-m relationships with Entities in basic-model
When...
I am using JPA and my test classes needs access to an EntityManager so it can execute some SQL during setup/teardown.
The issue I have is the test methods are using the same transaction as the...
class Bean
{
@Length(max=5)
String value;
}
Is there a way to inject a max value from spring context? Ie. I'd like to avoid hard coding max=5. This is useful in case of library...
I am planning to use Spring AOP for Transaction, but because Spring AOP uses dynamic proxy, a self-call won't be "intercepted", but does it matter? Ie.
@Transactional(rollbackFor =...
I followed your recommendation and it worked like a charm.
Thanks all for helping and thanks all for being persistent!!! Great crew hanging around here!!!
ClassPathXmlApplicationContext...
Here we go...thx!
ClassPathResource resource = new ClassPathResource("spring-context.xml");
BeanFactory factory = new XmlBeanFactory(resource);
editor =...
You got the full relevant stack trace in the original post :), but here we go, the absolutely full deal...
This line triggers the stack trace below...thx...
sessionFactory.getCurrentSession();...
That sounds like my problem too :)
Yes, I use mySQL 5.x, InnoDB and their appropriate JDBC driver.
I am scratching my head on the following debug from within Spring. You can see the it opened then closed the session...
Come on dude. If you have an inkling then out with it and be help instead of being a pain. You can clearly see in the original post the call() that produced the Spring stack trace...the rest is in...
Well, there is a stack trace and configuration in the original post. You can see that Spring tried to open the session only to close it immediately :)
The stack trace shows what the code does :)
Any ideas anyone? Thanks...
Thanks for the idea.
I decided that it is not bad for the service method to throw exceptions, so we are going to go that route instead.
Thanks!
public class MyService
{
@Transactional(rollbackFor=Exception.class)
public MyRsp myServiceMethod()
{
MyRsp rsp = new MyRsp();
try
{
...;