I have a question concerning reading uncommited entities with query, within active transaction.
For example, I read data from file. Each line contains value of one of entity's attributes but those values are not unique, so it's possible to have a multiple instances of the same entity. To eliminate duplicates, after reading every line I first check using a query, if an entity with that attribute value already exists. If no - I create one and persist it.
The problem is, that each entity created and persisted withing current transaction is invisible to future queries in this transaction, unless I do commit. The ugly solution is to use some external list or map to check if given entity was persisted.