Sergey! After offline discussion I managed to reproduce your problem. It seems that IgniteCache.size(...) doesn't take into account changes made during ongoing transaction.
It looks like a bug to me. I'll try to figure out what behavior is expected here and whether it is a known issue. Maybe it is worth to file a ticket in JIRA. For now you may check whether records are written to cache by using Cache.get(...) method instead of checking the size. Make sure to invoke get(...) in the thread that started the transaction, otherwise you risk to get a deadlock. Denis ср, 20 сент. 2017 г. в 16:23, Denis Mekhanikov <dmekhani...@gmail.com>: > Hi! > > Could you please provide a pure Ignite reproducer that won't involve > Hibernate OGM? > Right now it's hard to tell whether the problem is in Ignite or in > Hibernate. > > Thanks! > Denis > > ср, 20 сент. 2017 г. в 12:52, schernolys <sergey.chernol...@gmail.com>: > >> Hi! >> I am use of contributors of project "Hibernate OGM". I am preparing my PR >> for the project. >> I have a question. >> Problem is that part of tests is failed after migration from Ignite 1.9 to >> Ignite 2.1. These tests uses one feature (session.flush()). >> ____________________ >> em.getTransaction().begin(); >> Poem poem = new Poem(); >> poem.setName("L'albatros"); >> em.persist(poem); >> em.getTransaction().commit(); >> em.clear(); >> em.getTransaction().begin(); >> Poem poem2 = new Poem(); >> poem2.setName("Wazaaaaa"); >> em.persist(poem2); >> em.flush(); //*data not flushed to Ignite's cache* >> >> Assertions.assertThat(TestHelper.getNumberOfEntities(em)).isEqualTo(2L); >> em.getTransaction().rollback(); >> >> Assertions.assertThat(TestHelper.getNumberOfEntities(em)).isEqualTo(1L); >> ____________________ >> >> Please comment situation with em.flush() >> >> >> >> >> -- >> Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >> >