Entity difference

Report a typo

Two services get the same object from the database by ID.

Java
EntityManager entityManager1 = entityManagerFactoryBean.getObject().createEntityManager();
EntityManager entityManager2 = entityManagerFactoryBean.getObject().createEntityManager();

Post post1 = entityManager1.find(Post.class, 1);
Post post2 = entityManager2.find(Post.class, 1);
Kotlin
val entityManager1 = entityManagerFactoryBean.getObject()!!.createEntityManager()
val entityManager2 = entityManagerFactoryBean.getObject()!!.createEntityManager()

val post1 = entityManager1.find(Post::class.java, 1)
val post2 = entityManager2.find(Post::class.java, 1)

P.S. We know for sure that a post with this ID exists.
Select all correct statements:

Select one or more options from the list
___

Create a free account to access the full topic