I was able to solve it by adding an eclipseLink property to the persistence.xml:
<property name="eclipselink.target-server" value="weblogic" />
I don't have any clue why this property is not needed when the global JNDI name is used in the persistence.xml. The eclipse property is not needed then to make it work. When using the local JNDI name in the persistence.xml, this property is needed to make the transaction commits.