shardingsphere
shardingsphere copied to clipboard
java not used @transactional annotation ,data cannot be updated
Configured a local transaction, found that only @transactional can be added to the method to take effect, resulting in some single update operation in the project plus @transactional annotation, it feels very troublesome. I don't know if I haven't configured it myself, or does the local transaction of shardingsphere have to add @transactional annotation to the method to take effect?
version: ShardingSphere-Proxy 5.1.1
When the next transaction is executed, the update statement that does not open the transaction will commit the transaction together
Can you provide the demo to reproduce the problem?
@Service
public class StudentServiceImpl implements StudentService {
//not used @Transactional , When this method is executed, the updated student data cannot be seen
@Override
public Long update(Student student) {
return studentMapper.update(student);
}
//used @Transactional , normal execution
@Override
@Transactional
public Long updateT(Student student) {
return studentMapper.update(student);
}
}
sql:
update student set name='xxx' where id=1
Can you give me a simple runnable demo to investigate this issue,thank you. @liushangqing9803
Hello , this issue has not received a reply for several days. This issue is supposed to be closed.
Close due to no response.