CopyPastor

Detecting plagiarism made easy.

Score: 1.879369252516811; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Reposted on 2018-06-03
by Md. Sajedul Karim

Original Post

Original - Posted on 2018-06-02
by Md. Sajedul Karim



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Finally i solved this issue in this way :
1. Added `@EnableTransactionManagement` in Application class and also added `PlatformTransactionManager` Bean. Check the bellow code:
@Autowired private EntityManagerFactory entityManagerFactory; @Bean public PlatformTransactionManager transactionManager() { return new JpaTransactionManager(entityManagerFactory); } Here is the imports :
import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement;
2. In my scheduler code added bellow code:
@Scheduled(fixedRate = 60 *10*1000) @Transactional(propagation=Propagation.REQUIRES_NEW) public void reportCurrentTime() { doDatabaseTransaction(); }
Here is the imports :
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional;
Hope this will solve your problem :)


Finally i solved this issue in this way :
1. Added `@EnableTransactionManagement` in Application class and also added `PlatformTransactionManager` Bean. Check the bellow code:
> @Autowired > private EntityManagerFactory entityManagerFactory; > > @Bean > public PlatformTransactionManager transactionManager() > { > return new JpaTransactionManager(entityManagerFactory); > }
Here is the imports :
import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement;
2. In my scheduler code added bellow code:

> @Scheduled(fixedRate = 60 *10*1000) > @Transactional(propagation=Propagation.REQUIRES_NEW) > public void reportCurrentTime() { > doDatabaseTransaction(); > }
Here is the imports :
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional;
Hope this will solve your problem :)






        
Present in both answers; Present only in the new answer; Present only in the old answer;