0

add MVVM model to spring (for adding @Transactional annotation)

asked 2012-10-02 10:27:01 +0800

dmrzh gravatar image dmrzh
6

Hi
I want add transactions to some methods in MVVM model (which annotated with @Command)

I try add @Transactional annotation but it not work as model not managed with spring.

Is necessary add aspectj advices or possible make this with pure java?

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-10-03 05:07:31 +0800

iantsai gravatar image iantsai
2755 1

You shouldn't make a ViewModel's method to be transactional, this is not a good design.
A better way is your vm has a mySpringBean and such bean contains the transactional method.
You can take a look at these java srcs:
OrderViewViewModel.java
UserOrderManager.java

OrderViewModel is directly used by ZK, and transactional stuff is reserved in UserOrderManager.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-10-02 10:27:01 +0800

Seen: 76 times

Last updated: Oct 03 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More