Last active
August 20, 2018 21:56
-
-
Save jerolba/f6ba04bc873a93876b4ea555aa69e197 to your computer and use it in GitHub Desktop.
A register each time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EntityTransaction tx = entityManager.getTransaction(); | |
Iterator<TripEntity> iterator = trips.iterator(); | |
while (iterator.hasNext()) { | |
tx.begin(); | |
entityManager.persist(iterator.next()); | |
tx.commit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment