Creating Persistable object makes entry in the dB if its not committed yet

0
  Hi, If I create a FileDocument object (or any persistable object ) in the MF and don’t commit it, why I am seeing the entry in the database against it.  If I have this object in the dataview, then there will be stale objects created in the memory. How to get rid these objects from the dB.  
asked
2 answers
5

FileDocument objects are special. If you use the default upload/download widget, it will commit your upload as soon as you push any button on your page. That means that you may need to implement some custom cancel logic. Otherwise (depending on how you did build your app), you will end up with orphaned FileDocument objects in your database.

answered
0

If you are not committing the persistable entity then it is only shown in the browser for the session as the object itself is still in client side memory. If you log out and login again it gets cleaned then.

If you are facing this in datagrid or similar view then make the data source as Database or Xpath instead of Association, the it will only show the data that is present in database.

 

To fix unnecessary FileDocument objects, while creating the object of FileDocument set attribute DeleteAfterDownload as true.

answered