Database Manager
Comprehensive database management system for the McMMO Core plugin.
This class serves as the central hub for all database operations within the McMMO ecosystem. It manages connection pooling using HikariCP, handles database schema creation and maintenance, and provides reliable database connections to all other components of the plugin system.
Key Responsibilities:
Database connection pool management using HikariCP for optimal performance
Automatic database schema creation and validation for all core tables
Connection health monitoring and automatic recovery mechanisms
Thread-safe database access for multi-threaded plugin operations
Configuration-driven database setup supporting MySQL with SSL options
Comprehensive error handling and logging for database operations
The DatabaseManager follows a singleton-like pattern within the plugin lifecycle, being initialized once during plugin startup and maintained throughout the server's runtime. It supports both online and offline player data management scenarios.
Database Schema Coverage:
Player core data (levels, currency, flags, preferences)
Player inventory persistence across sessions
Skills and progression system data
Quest system state and completion tracking
Moderation tools (mutes, ignores)
Companion and mount system data
Dungeon and raid lockout management
Economy system (auctions, mail)
Guild system with hierarchical permissions
Thread Safety: This class is designed to be thread-safe through the use of HikariCP's connection pooling, which handles concurrent access to database connections safely across multiple plugin threads and async operations.
Performance Considerations:
Uses connection pooling to minimize connection overhead
Implements prepared statement caching for frequently used queries
Configures MySQL-specific optimizations for batch operations
Provides configurable pool sizing based on server load requirements
Since
1.0.0
Author
McMMO Core Team
Parameters
The CorePlugin instance that owns this DatabaseManager
See also
for connection pooling implementation
for database configuration management