just write a demo class to test it.
Type: Posts; User: yerlluo; Keyword(s):
just write a demo class to test it.
how you deploy your application? standalone application or deployed in the container(tomcat?)?
I think so.
show me the spring configuration file please.
did you add hibernate.jar to the project's classpath? or check the version of hibernate.jar.
ok, thank you very much, Bron !
Bron, thanks for your reply, my question is: why could not do like following:
public class Person {
private Person spouseRef;
// getters and setters.
}
I tried it and it's OK.
When reading spring reference, some words puzzled me:
Please note that the p-namespace is not quite as flexible as the standard XML format - for
example particular, the 'special' format used to...
Thanks for your reply!
Can anyone tell me that STS 2.0 charges free or not?
the following words from "http://www.springsource.com/node/1384".
what's this mean?
Pricing and availability
STS 2.0 is available for free...
you started two transactions with listForms method, and they did not do propagation properly.
can you alternative PROPAGATION_REQUIRED to PROPAGATION_SUPPORTS, and try to run your application and then tell me your result?
I am very grateful to you for your advice.
make the datasource bean prototype. but then you must destory the old datasource bean immediately after you discard it. In this situation maybe you want to change datasource between various ones.
...
what is your requirement?
changes between several datasources?
or
changes between a lot?
no, datasource bean should be singleton, so there is no effect when you reset System property because the datasource instance is already be there.
maybe you should config another datasource bean,...
you lovely guy!
It will keep data in consistent state.
you could also use declarative transaction in dao layer.
annotate your method(s) with @Transactional, and you can set your rollback rule by its property. like...
I got it!
see my demo:
<bean id="dataSouce" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>...
In hibernate configuration file, you can use ${XXX} to replace the value, for example:
<property name="hibernate.connection.username">${username}</property>
and you should set "username" as...
@Transactional
public void methodName()
{
......
Ticket ticket = .........
......
User user = ticket.getUser();
......
}
You can do operations in one transaction using spring transaction management.
Let me have look at your code, ok?
For your first error, you can remove the second "import ..." statement, and let IDE auto import it.
For the second error, because that your UserService class not extends HibernateDaoSupport, so...