Did you run the tests on the same server or at least on identical servers.
Did you run the test against the same PostgrSQL database engine?
~500 transactions/second during your performance test? Meaning about 1.000 transactions during the execution of your test function?
And ~2.000 transactions/second with Wildfly, in total 20.000 transactions executed during your test? 20 times number of transactions for the same work?
GlassFish uses eclipselink as it's persistence provider, Wildfly is using Hibernate.
Do you use SessionBeans, Bean oder Container managed transactions, ....?
maybe enabling SQL logging for hibernate might show what is making more queries.
and tuning JPA mappings could help.
another possibility is that you don't have second level caching enabled on WildFly, where it is enabled on GlassFish.