A stack overflow is usually down to something being recursively called.
Do you have any event handlers on any entities in your domain model? For example, you may have a before commit event making changes and committing, thus triggering the before commit event again, and getting stuck in an endless cycle of change and commit before running out of memory.
Good luck!