I have a MDB that receives data from a JSM queue in XML format. After converting the XML to proper Value Objects using JAXB, it calls a DAO.
We have configure the App server (WLS 8.1)to have 10 MDB in the pool.
The DAO is a singleton with a none static private data member that holds the DataSource.
The DAO.add() operation gets connection from the data source and performs the add.
When we put one msg on the JMS queue we see the transaction time in DAO.add() is an about 1 sec.
When we put 30 msgs on the JMS queue we see 10 threads accessing the singleton instance of the DAO.
I was hoping to see the DB transactions started by these 10 threads would be executed in parallel they way threaded operations should behave considering the context switching factor however what I am seeing from the log files is that the DB transactions are serialized meaning they get executed one at a time!!?? Therefore it takes 10 sec for the 10 threads to complete their work. I was expecting to see something like 3 to 4 sec for all 10 thread to complete the add operation.
Anyone has any ideas? Could it be that the Datasource is a private member of the Singleton DAO and each thread who calls the DAO.add() gets queued up to get access to the Data Source?
Any idea would be great.