Hi, Would someone explain to me under what circumstances a find returns a null when, in fact, a row exists with that primary key. According to Dan (or rather his fine book) find() always hits the database. The underlying DB is MySQL 5.1.48 with the 5.1.10 Connector/J. It might be relegated to when the application is under heavy load. The particular application has an EntityManager per thread so as not to have any multithreaded or concurrency issues.
A secondary question I had was what is the underlying difference between find and select entityObject where primarykey = :key
Where I am confused is if this might be a timing thing although the record existed in the database for in excess of an hour and the LUW lifespan is but a few seconds tops. If, in fact, the find bypasses the Persistence Context and hits the database, I can not fathom why it wouldn't find it. I did verify the key object in the find is the proper type (Long vs Int).
If there is any additional information that might shed light, please let me know.
Thanks,
Walt
|