
Modern applications demand more from their databases than ever before.
AI-powered search experiences rely on vector similarity queries. Logistics and mobility applications need geospatial intelligence. Document-centric APIs increasingly blend relational and JSON models. Operations teams require end-to-end observability that connects application activity with database behavior. And all of this must happen without sacrificing developer productivity.
Oracle AI Database has invested heavily in these areas, introducing powerful capabilities such as AI Vector Search, JSON Relational Duality Views, advanced transaction management, and enhanced observability tooling. With Micronaut 5, these Oracle-native features become significantly easier for Java developers to adopt.
Rather than forcing developers to write database-specific plumbing code, Micronaut integrates these capabilities directly into its familiar programming model. Repository methods, annotations, and configuration drive the Oracle-specific behavior automatically, allowing teams to focus on application logic while still taking full advantage of the database platform.
Let’s explore some of the most exciting Oracle-focused enhancements available in Micronaut 5.
Build location-aware applications with Oracle Spatial
Location data powers many of today’s most important applications, from ride-sharing platforms and delivery services to retail analytics and asset tracking.
Oracle Spatial has long provided powerful geospatial capabilities through SDO_GEOMETRY, but historically developers often had to work directly with Oracle-specific APIs and SQL constructs. Micronaut 5 dramatically simplifies that experience.
Micronaut Data now includes first-class geospatial model types such as Point, Polygon, and collection types, allowing developers to model location data directly in Java while Micronaut handles the Oracle Spatial integration underneath.
@MappedEntity("driver")
public class Driver {
@Id
@GeneratedValue
private Long id;
@Srid(4326)
@Index(columns = "location")
private Point location;
}
@JdbcRepository(dialect = Dialect.ORACLE)
interface DriverRepository extends CrudRepository<Driver, Long> {
List<Driver> findByLocationNear(Point point, double distance);
}
The repository method tells the story. A simple Near query automatically becomes an Oracle Spatial proximity search using SDO_WITHIN_DISTANCE.
Developers can write expressive repository methods while Oracle AI Database performs optimized spatial calculations using its native indexing and query engine.
For teams building delivery systems, fleet management platforms, geofencing applications, or any service that depends on proximity search, this dramatically reduces the complexity of working with geospatial data.
Bring AI-powered search to your applications with Vector Search
Vector search has quickly become one of the most important building blocks of modern AI applications.
Whether you’re implementing retrieval-augmented generation (RAG), semantic search, recommendation systems, document similarity, or conversational AI, vector embeddings are increasingly central to application architecture.
Oracle AI Database Vector Search provides enterprise-grade vector storage and similarity search directly within the database. Micronaut 5 makes these capabilities available through the same repository abstraction developers already use for traditional data access.
@MappedEntity("document_embedding")
public record DocumentEmbedding(
@Id
@GeneratedValue
Long id,
@VectorIndex(
vectorIndexType = VectorIndexType.IVF,
distanceType = VectorIndexType.DistanceType.COSINE,
accuracy = 90
)
@Column(length = 384)
Vector embedding
) {
}
Repository methods can express similarity search directly:
@JdbcRepository(dialect = Dialect.ORACLE)
interface DocumentEmbeddingRepository extends CrudRepository<DocumentEmbedding, Long> {
List<DocumentEmbedding> findTop2ByEmbeddingNear(
Vector vector,
Double maxDistance
);
SearchResults<DocumentEmbedding> searchByEmbeddingNear(
Vector vector,
Score maxDistance,
ScoringFunction function
);
List<DocumentEmbedding> findByEmbeddingWithin(
Vector vector,
Double distance
);
List<DocumentEmbedding> findTop10ByEmbeddingNearOrderByIdDesc(
Vector vector,
Double maxDistance
);
List<DocumentEmbedding> findByEmbeddingBetween(
Vector lowerBound,
Vector upperBound
);
}
Behind the scenes, Micronaut Data automatically generates Oracle vector search queries using VECTOR_DISTANCE and can even generate Oracle vector index DDL during schema generation.
The result is a remarkably natural developer experience for AI workloads. Instead of introducing a separate vector database or maintaining synchronization between systems, developers can build AI-powered features directly on Oracle AI Database using familiar Micronaut repository patterns.
Model relational and JSON data together with JSON Relational Duality Views
One of the most innovative capabilities introduced in recent Oracle AI Database releases is JSON Relational Duality Views.
Duality Views allow developers to work with JSON documents while Oracle AI Database continues to store and manage the underlying data relationally. Applications gain the flexibility of document-centric development without sacrificing the consistency, performance, and transactional guarantees of the relational model.
Micronaut 5 embraces this capability through support for @JsonView and @JsonSubView.
@JsonView(entity = Student.class)
public record StudentView(
@Id
@GeneratedValue
Long id,
String name,
@Relation(value = Relation.Kind.ONE_TO_MANY)
@JoinColumn(name = "id", referencedColumnName = "student_id")
List<StudentScheduleSubView> schedule,
@JsonProperty("_metadata")
Metadata metadata
) {
}
Developers can model JSON documents directly as Java records while Micronaut generates the Oracle JSON Relational Duality View definitions required by the database.
This creates a compelling development experience for modern APIs. Teams can expose JSON-centric interfaces to clients while Oracle AI Database maintains a normalized relational representation underneath. The database effectively bridges two worlds that have traditionally required developers to choose one approach or the other.
Micronaut also integrates with Oracle’s ETAG-based optimistic concurrency model, making it straightforward to build highly concurrent document-oriented applications on top of Oracle AI Database.
Prioritize critical workloads with Oracle transaction priority
Not all transactions are equally important.
Modern systems frequently contain a mix of customer-facing operations, background processing, analytics workloads, and batch jobs. Oracle transaction priority allows the database to distinguish between these workloads and make more intelligent decisions under contention.
Consider an e-commerce application processing customer orders while also running inventory reconciliation jobs. During periods of database contention, order placement transactions can be assigned a higher priority than background reconciliation work, helping ensure customer-facing operations remain responsive.
Micronaut 5 exposes this capability directly through @OracleTransactional.
@Singleton
class InventoryService {
@OracleTransactional(
priority = OracleTransactional.Priority.MEDIUM
)
void updateInventory() {
// repository updates here
}
}
Rather than requiring manual session management, Micronaut automatically applies and restores Oracle transaction priorities as transactions begin and complete.
For applications with varying workload characteristics, this provides a simple mechanism to align application intent with Oracle AI Database transaction management capabilities.
Make Oracle sessions instantly identifiable
One of the challenges of operating large-scale systems is connecting database activity back to the application code responsible for it.
When a DBA examines active sessions, performance issues, or workload spikes, knowing which service, repository, or operation generated the activity can significantly reduce troubleshooting time.
Micronaut 5 improves this experience by automatically integrating application metadata into Oracle session information.
micronaut:
application:
name: delivery-service
datasources:
default:
enable-oracle-client-info: true
Repository operations can further enrich Oracle session metadata:
@ClientInfo.Attribute(
name = "OCSID.MODULE",
value = "driver-search"
)
@JdbcRepository(dialect = Dialect.ORACLE)
interface DriverRepository extends CrudRepository<Driver, Long> {
@ClientInfo.Attribute(
name = "OCSID.ACTION",
value = "nearby-drivers"
)
List<Driver> findByLocationNear(Point point, double distance);
}
The result is richer visibility within Oracle session views. Database administrators can immediately correlate activity back to specific Micronaut services and repository methods, improving diagnostics, performance analysis, and operational awareness.
Connect Oracle UCP and OpenTelemetry
Observability is no longer optional.
Teams increasingly expect to trace requests across services, databases, connection pools, and infrastructure components. Micronaut 5 helps bridge Oracle AI Database operations into modern OpenTelemetry-based observability stacks.
By combining:
- Oracle Universal Connection Pool (UCP)
- Micronaut SQL
- Micronaut Tracing
- OpenTelemetry instrumentation
developers can gain visibility into request execution, JDBC activity, connection pool behavior, and application performance from a unified tracing platform.
dependencies {
implementation("io.micronaut.sql:micronaut-jdbc-ucp")
implementation("io.micronaut.tracing:micronaut-tracing-opentelemetry-http")
runtimeOnly("com.oracle.database.jdbc:ojdbc11")
runtimeOnly("com.oracle.database.jdbc:ucp")
runtimeOnly("io.opentelemetry:opentelemetry-exporter-otlp")
}
When combined with Oracle client information, traces can be correlated with database session metadata, creating a powerful end-to-end operational picture that spans both application and database layers.
For cloud-native teams running mission-critical workloads, this dramatically improves the ability to understand system behavior and diagnose issues quickly.
Bringing Oracle innovation directly into the Micronaut programming model
The most exciting aspect of these enhancements isn’t any single feature.
It’s the fact that advanced Oracle AI Database capabilities now feel like a natural extension of Micronaut itself.
A repository method using Near can become an Oracle Spatial query or an AI vector similarity search. Java records can map directly to JSON Relational Duality Views. Transaction priorities can be applied declaratively. Session metadata and OpenTelemetry integration can be enabled through configuration and annotations rather than custom infrastructure code.
The result is a developer experience that combines Micronaut’s productivity and low-overhead architecture with some of Oracle AI Database’s most innovative capabilities.
As Oracle continues investing in AI, JSON-native development, observability, and cloud-scale data platforms, Micronaut 5 provides Java developers with a direct path to those innovations. Teams can adopt powerful new database features while continuing to write concise, maintainable, and idiomatic Micronaut applications.
For organizations building the next generation of intelligent, data-intensive applications, Micronaut 5 and Oracle AI Database together provide a compelling foundation for what comes next.
