| Unit test for validate-atmost-once-period. |
| |
| |
| |
| Enable validation. |
| |
| Iteration 1: |
| Appclient first calls an ejb method to initialize the connection pool. |
| |
| After first call to ejb, database is restarted. |
| |
| Iteration 2: |
| Appclient calls the same ejb method. With validation on, all bad connections are |
| removed and newly created. Test must work fine. |
| |
| Enable validateAtmostOncePeriod (set 30 seconds) |
| |
| database is restarted. |
| |
| Iteration 3: |
| Appclient calls the same ejb method. Since validateAtmostOncePeriod is set, connection |
| will not be validated and this method must throw exception. |
| [This is a negative test to verify validateAtmostOncePeriod feature. |
| Purpose of validateAtmostPeriod is to optimize/miminize the validation calls to database.] |