bx-orm-session-management

Manage Hibernate session and SessionFactory lifecycles within the BoxLang runtime.

2|Updated Apr 11, 2024
One-click install
npx skills add https://github.com/ortus-boxlang/bx-orm --skill bx-orm-session-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bx-orm-session-management
Source: https://github.com/ortus-boxlang/bx-orm/tree/main/.agents/skills-custom/bx-orm-session-management
Command: npx skills add https://github.com/ortus-boxlang/bx-orm --skill bx-orm-session-management

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the complexity of managing Hibernate session lifecycles, datasource bindings, and request-scoped state within the BoxLang runtime, preventing memory leaks and ensuring thread-safe database interactions.

Core Features & Use Cases

  • Lifecycle Management: Automates the opening, flushing, and closing of Hibernate sessions across application and request scopes.
  • Context Awareness: Provides tools to manage ORMContext attachments, ensuring sessions are correctly bound to the current thread or request.
  • Use Case: Use this skill to debug session factory initialization issues or to ensure that HQL queries are executed within the correct transactional context during high-concurrency operations.

Quick Start

Use the bx-orm-session-management skill to inspect the current ORMContext and verify that all active sessions are properly closed for the current request.

Frequently Asked Questions about bx-orm-session-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage Hibernate session lifecycles in BoxLang to prevent memory leaks?

Hibernate session management in BoxLang automates opening, flushing, and closing sessions across application and request scopes to prevent memory leaks and ensure thread-safe database interactions.

Why does my HQL query fail during high-concurrency operations in BoxLang?

HQL queries fail during high-concurrency operations when sessions are not bound to the correct transactional context, requiring proper ORMContext attachments and thread-scoped datasource bindings to execute correctly.

How do I ensure proper cleanup of database connections when shutting down the BoxLang ORM?

Proper cleanup of database connections during BoxLang ORM shutdown requires managing the SessionFactory lifecycle and verifying that all active Hibernate sessions are properly closed for the current request.

Does this ORM session management skill handle datasource binding across multiple application scopes?

Yes, the ORM session management skill operates across application, request, and thread scopes to ensure consistent datasource binding and proper resource cleanup during high-concurrency database interactions.

What is the best way to debug session factory initialization issues in BoxLang ORM?

Debugging session factory initialization issues in BoxLang ORM is best handled by inspecting the current ORMContext to verify that all active Hibernate sessions are properly closed and correctly bound to the current request.