Authored by csgyoho

grass-syn-transaction

... ... @@ -191,7 +191,9 @@ public class YohoNowDataSynService {
needSyncList.add(articleLabel);
});
}
publicEntityManager.getTransaction().begin();
if(!publicEntityManager.getTransaction().isActive()){
publicEntityManager.getTransaction().begin();
}
StringBuilder sb = null;
for(PublicArticleLabel attention : needSyncList){
if(null == sb ){
... ... @@ -208,7 +210,9 @@ public class YohoNowDataSynService {
}
private void savePublicLabels(List<PublicLabel> needSyncLabelList){
publicEntityManager.getTransaction().begin();
if(!publicEntityManager.getTransaction().isActive()){
publicEntityManager.getTransaction().begin();
}
StringBuilder sb = null;
for(PublicLabel attention : needSyncLabelList){
if(null == sb ){
... ... @@ -409,7 +413,9 @@ public class YohoNowDataSynService {
}
private void savePublicUserAttentions(List<PublicUserAttention> userAttentions){
publicEntityManager.getTransaction().begin();
if(!publicEntityManager.getTransaction().isActive()){
publicEntityManager.getTransaction().begin();
}
StringBuilder sb = null;
for(PublicUserAttention attention : userAttentions){
if(null == sb ){
... ... @@ -505,7 +511,9 @@ public class YohoNowDataSynService {
}
private void savePublicUserPraises(List<PublicUserPraise> articlePraises){
publicEntityManager.getTransaction().begin();
if(!publicEntityManager.getTransaction().isActive()){
publicEntityManager.getTransaction().begin();
}
StringBuilder sb = null;
for(PublicUserPraise attention : articlePraises){
if(null == sb ){
... ...