Merge branch 'test6.8.9'
Showing
1 changed file
with
8 additions
and
0 deletions
@@ -192,7 +192,9 @@ public class YohoNowDataSynService { | @@ -192,7 +192,9 @@ public class YohoNowDataSynService { | ||
192 | needSyncList.add(articleLabel); | 192 | needSyncList.add(articleLabel); |
193 | }); | 193 | }); |
194 | } | 194 | } |
195 | + if(!publicEntityManager.getTransaction().isActive()){ | ||
195 | publicEntityManager.getTransaction().begin(); | 196 | publicEntityManager.getTransaction().begin(); |
197 | + } | ||
196 | StringBuilder sb = null; | 198 | StringBuilder sb = null; |
197 | for(PublicArticleLabel attention : needSyncList){ | 199 | for(PublicArticleLabel attention : needSyncList){ |
198 | if(null == sb ){ | 200 | if(null == sb ){ |
@@ -209,7 +211,9 @@ public class YohoNowDataSynService { | @@ -209,7 +211,9 @@ public class YohoNowDataSynService { | ||
209 | } | 211 | } |
210 | 212 | ||
211 | private void savePublicLabels(List<PublicLabel> needSyncLabelList){ | 213 | private void savePublicLabels(List<PublicLabel> needSyncLabelList){ |
214 | + if(!publicEntityManager.getTransaction().isActive()){ | ||
212 | publicEntityManager.getTransaction().begin(); | 215 | publicEntityManager.getTransaction().begin(); |
216 | + } | ||
213 | StringBuilder sb = null; | 217 | StringBuilder sb = null; |
214 | for(PublicLabel attention : needSyncLabelList){ | 218 | for(PublicLabel attention : needSyncLabelList){ |
215 | if(null == sb ){ | 219 | if(null == sb ){ |
@@ -410,7 +414,9 @@ public class YohoNowDataSynService { | @@ -410,7 +414,9 @@ public class YohoNowDataSynService { | ||
410 | } | 414 | } |
411 | 415 | ||
412 | private void savePublicUserAttentions(List<PublicUserAttention> userAttentions){ | 416 | private void savePublicUserAttentions(List<PublicUserAttention> userAttentions){ |
417 | + if(!publicEntityManager.getTransaction().isActive()){ | ||
413 | publicEntityManager.getTransaction().begin(); | 418 | publicEntityManager.getTransaction().begin(); |
419 | + } | ||
414 | StringBuilder sb = null; | 420 | StringBuilder sb = null; |
415 | for(PublicUserAttention attention : userAttentions){ | 421 | for(PublicUserAttention attention : userAttentions){ |
416 | if(null == sb ){ | 422 | if(null == sb ){ |
@@ -506,7 +512,9 @@ public class YohoNowDataSynService { | @@ -506,7 +512,9 @@ public class YohoNowDataSynService { | ||
506 | } | 512 | } |
507 | 513 | ||
508 | private void savePublicUserPraises(List<PublicUserPraise> articlePraises){ | 514 | private void savePublicUserPraises(List<PublicUserPraise> articlePraises){ |
515 | + if(!publicEntityManager.getTransaction().isActive()){ | ||
509 | publicEntityManager.getTransaction().begin(); | 516 | publicEntityManager.getTransaction().begin(); |
517 | + } | ||
510 | StringBuilder sb = null; | 518 | StringBuilder sb = null; |
511 | for(PublicUserPraise attention : articlePraises){ | 519 | for(PublicUserPraise attention : articlePraises){ |
512 | if(null == sb ){ | 520 | if(null == sb ){ |
-
Please register or login to post a comment