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

JPAContext is not ready error on second save call on Dao #41

Open
swubily opened this issue Jan 28, 2019 · 2 comments
Open

JPAContext is not ready error on second save call on Dao #41

swubily opened this issue Jan 28, 2019 · 2 comments

Comments

@swubily
Copy link

swubily commented Jan 28, 2019

Calling dao.save() twice in a crone job method, it will report "JPAContext is not ready" error on second save.

@Cron("cron.order.delivered")
public void orderDelivered(){
         OrderDay orderDay = new OrderDay();
         orderDay.setAmount(BigDecimal.ZERO);
         dao.save(orderDay);
         OrderDay orderDay2 = new OrderDay();
         orderDay2.setAmount(BigDecimal.ZERO);
         dao.save(orderDay2);
}

dao.save(orderDay2) will trigger the issue

@greenlaw110
Copy link
Contributor

greenlaw110 commented Jan 28, 2019

@swubily please report your actframework and act-jpa-common version, also are you using act-eclipselink or act-hibernate?

@greenlaw110 greenlaw110 changed the title JPAContext is not ready JPAContext is not ready error on second save call on Dao Jan 28, 2019
@swubily
Copy link
Author

swubily commented Jan 29, 2019

actframework : 1.8.17.1
act-jpa-common version: 1.5.5
This issue seems caused by @createdat, @LastModifiedAt; if I add one of the annotation in entity, the issue will be reproduced.

` code:

@CreatedAt
@Column(name = "create_time")
public Date createTime;
@LastModifiedAt
@Column(name = "update_time")
public Date updateTime;`

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