Support to the new persistence api added (6.0.x)

Well, I cleaned the commit comments. 
I hope it is okay now.

[]'s