Let me provide a comprehensive solution addressing session timeout tuning, batch job optimization, and validation process reliability for your scenario.
Architecture Solution:
The core issue is mixing interactive user sessions with long-running batch operations. Here’s the proper implementation approach:
1. Session Timeout Tuning - Multi-Layer Configuration:
First, align all timeout settings across the stack:
# agile.properties
com.agile.session.timeout=3600000
com.agile.batch.session.enabled=false
com.agile.batch.system.context=true
Application server configuration (WebLogic):
<session-descriptor>
<timeout-secs>3600</timeout-secs>
</session-descriptor>
However, extending timeouts for batch jobs is NOT the recommended solution.
2. Batch Job Optimization - Proper Implementation:
Refactor validation jobs to use the AgileScheduledJob framework:
public class ValidationBatchJob extends AgileScheduledJob {
public void execute() {
IAgileSession systemSession = getSystemSession();
// Batch processing logic here
}
}
Register the job in scheduled-jobs.xml:
<job name="ValidationBatch" class="ValidationBatchJob">
<trigger type="manual"/>
</job>
3. Validation Process Reliability - Complete Solution:
Implement checkpointing for large batch operations:
// Pseudocode - Key implementation steps:
1. Initialize batch job with checkpoint manager
2. Process items in chunks of 500 records
3. After each chunk, persist progress state to database
4. If job fails, resume from last successful checkpoint
5. Update validation status table with completion metrics
// See Agile SDK documentation: Batch Processing Guide
Implementation Steps:
-
Create System Service Account:
- Create dedicated user “BATCH_VALIDATION_SVC” with minimal required privileges
- Grant only validation-mgmt access and necessary read permissions
- Enable audit logging for this account
-
Deploy Scheduled Job:
- Package ValidationBatchJob class in custom JAR
- Deploy to `$AGILE_HOME/integration/sdk/extensions
- Register in scheduled-jobs.xml configuration
- Restart application server
-
Configure Checkpointing:
- Create checkpoint tracking table in Agile database
- Implement progress persistence every 500 items
- Add recovery logic to resume from last checkpoint
-
Update UI Trigger:
- Modify validation-mgmt interface to launch scheduled job instead of direct execution
- Job runs asynchronously under system context
- User receives job ID for status tracking
Performance Optimization:
- Set batch chunk size to 500 items (balances memory and checkpoint frequency)
- Enable parallel processing for independent validation rules
- Configure connection pool:
maxActive=50, maxIdle=20 for batch operations
- Schedule jobs during off-peak hours to maximize available resources
Monitoring and Reliability:
Add comprehensive logging:
log4j.logger.com.agile.validation.batch=DEBUG, BATCH_LOG
log4j.additivity.com.agile.validation.batch=false
Implement job monitoring dashboard showing:
- Current progress (items processed / total items)
- Estimated completion time
- Checkpoint status
- Failure recovery status
Testing Validation:
- Test with 5000-item batch to verify no timeout issues
- Simulate mid-job failure and verify checkpoint recovery
- Monitor system session usage to confirm no user session dependency
- Validate audit trail captures all batch operations under service account
This solution eliminates session timeout constraints entirely for batch operations while maintaining security through proper service account implementation and comprehensive audit logging. Your validation jobs will now complete reliably regardless of duration, with automatic recovery capability if interruptions occur.