Recently i have seen a new exception in my production environment while 7 users working on deployed application
And i was not able understand why this exception occurs, i googled about it and found some very interesting facts about BC4J.
BC4J creates temporary database object (PS_TXN and PS_TXN_SEQ), that are used by ADF to maintain state of user session as per DB, it has facility to store temporary data in BLOB column to avoid out of memory problem.
visit this link to read about these objects- (How to manage PS_TXN and PS_TXN_SEQ)
now i have seen cascading exception after this oracle.jbo.PcollException, PColl refers persistent collection facility.
when ADF was unable to insert data in PS_TXN table, java.sql.SQLException occurs, connection forcefully closed
- Now i have counted rows in PS_TXN , there was more 3000 rows, have cleared all rows
- after this again 7 users worked for 3hrs and there was no exception, no bizarre behaviour
- Now once connection is closed, ADF errors starts coming out as NullPointerException
- Finally what i come to know that in order to avoid this kind of exceptions , we have to schedule a job to clear data in PS_TXN
What PS_TXN stores-
- PS_TXN structure-
- Suppose you have a search query with more that 10000 records and that is on page as af:table, when user scrolls through table to view records then to avoid out of memory problem bc4j stores extra result set in a temporary storage (PS_TXN) in BLOB column
- When AM (Application Module) passivates and in AM pooling dofailover is set to true,pending state and changes are stored in this table
- In case of Multiple users , session information stored in PS_TXN, each user session must be serialised with database, otherwise database object can't behave as per separate user session
- to test a scenario , i have deleted all data from PS_TXN in default HR Schema and created a ADF application that makes uses of HR's tables
- Run that application , till few operations on application there was no data in PS_TXN table , when i opened application in 3 browser's window and then performed some operations after this there was 2 rows in PS_TXN, it means ADF automatically insert data in PS_TXN for state,session,AM Changes. developer need not to worry about it
At-last summary is - Always keep in mind these db objects if you are facing unexpected behaviour of ADF application in production (multi user) environment, if your application working perfectly on development environment but not in production always check it and schedule a job to clear table PS_TXN