Fix delete() in Entity.java with tx.success(), add portfolio functions

and integration test for them