Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solon Scheduling不支持数据库事务 #329

Open
Gn3po4g opened this issue Jan 23, 2025 · 1 comment
Open

Solon Scheduling不支持数据库事务 #329

Gn3po4g opened this issue Jan 23, 2025 · 1 comment

Comments

@Gn3po4g
Copy link

Gn3po4g commented Jan 23, 2025

@Scheduled(name = "test")
public class TestJob implements Runnable {
    @Override
    @Tran
    public void run() {
    }
}

如代码所示,@Tran注解无法启用事务。

@noear
Copy link
Member

noear commented Jan 24, 2025

确实如此。。。你换种方式:

//注解在组件的方法上

@Component
public class JobBean {
    @Tran
    @Scheduled(fixedRate = 1000 * 3)
    public void job11(){
        System.out.println("我是 job11 (3s)");
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants