I went through very painful experience in the last year (quite complex XPages application with heavy load of Java code), so I will share:
- there is "unexpected behavior" in recycling mechanism, expected to be fixed in 8.5.3: if you recycle object, another getter called during the same request will pass the same - already recycled - object. It is easily reproducible for databases and documents. This APAR https://www-304.ibm.com/support/docview.wss?uid=swg1LO58442 recommends not to recycle document, if you use it as datasource, but the problem is general to all recyclable objects, I think.
- You must recycle if working with collections. You must not recycle, if you are expecting to use that object another time in the same request - for example as datasource, or in two different methods called in sequence, as mentioned previously. Very tricky if you want to process any collection twice :-(
- Never, never, never store Domino objects (except for one request) - for example as static field or session/app/view scoped variables. Even though it seems to work (as I was happy about at first), it will get server to knees easily.
FK