'Calling retrieve query by JDBCTemplate after jpa save method not working in spring boot

I faced a problem that calling retrieve query by JDBCTemplate after jpa save method not working. I Have 8 jpa save method and after that a retrieve method using JDBCTemplate invoke, but retrieve(calling execute select) method not working means not return correct result but after thread.sleep(1000) or in debug mode it returns correct result.
Also, flush after saving not working.

Sample :

class serviceA{
A.save()
B.save()
C.save()
E.save()
ServiceB.execute()
}

class ServiceB{

execute("select data from A,B,C,D .....")

}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source