The root cause has been identified now.
The issue was that the ARRAY FETCH SIZE of the connection was reset to 1 in 4.0 after migration.This happened for all the connections(75 connections)
In XiR2, it was configured at 250.
We had to manually modify the ARRAY FETCH SIZE in 4.0 for all the 75 connections and then performance was back to normal.
Any pointers on why the ARRAY FETCH SIZE got reset?