I use in the project such a terrible thing as EJB. More to the point, there are functions that add a lot of data to the database at once and they are synchronized immediately with the EJB, and there are methods that add one tuple and there is no synchronization with the EJB. I read in the JEE6 Tutorial that I need to use flush (), I tried it, but it did not help. Maybe someone knows how to force synchronization :-)
I use NetBeans 6.9.1, all classes of Entity, Session generated using it, as AppServer'a GlassFish out of the box with NetBeans.