You create an INSTANCE of your CurrentUserProvider, and specify that as the value of "datanucleus.CurrentUserProvider" to the persistence properties. If you insist on creating a PMF in that way you use the second argument to input OVERRIDING PROPERTIES.