Skip to content

Conversation

@kabir
Copy link
Collaborator

@kabir kabir commented Sep 23, 2025

Description

Fixes #279 and #278

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kabir, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a significant enhancement by introducing a new module that implements the TaskStore interface using Jakarta Persistence API (JPA). This allows the application to persist tasks in a relational database, moving beyond in-memory storage. The implementation focuses on robustness with transactional support, flexibility through JSON serialization of tasks, and portability across various Jakarta EE environments. This change addresses the need for durable and scalable task management.

Highlights

  • JPA-based TaskStore: Introduces a new extras/taskstore-database-jpa module providing a JPA implementation for TaskStore, enabling task persistence in relational databases.
  • JSON Serialization: Tasks are serialized to JSON for storage, allowing for flexible schema evolution within the database.
  • Transactional Operations: All task operations (save, get, delete) are transactional, ensuring data integrity and consistency.
  • CDI Integration: The new JpaDatabaseTaskStore is an @Alternative CDI bean, automatically replacing the default InMemoryTaskStore when included in a project.
  • Comprehensive Testing: Includes dedicated unit tests (JpaDatabaseTaskStoreTest) and end-to-end integration tests (JpaDatabaseTaskStoreIntegrationTest) to ensure functionality and correct client-server flow.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new JPA-based TaskStore implementation, which is a great addition for enabling database persistence of tasks. The implementation is well-structured and includes comprehensive unit and integration tests. I've identified a few areas for improvement, including a bug in an integration test, a potential packaging issue with a CDI configuration file, and some opportunities to simplify the code and improve the entity definition. The documentation is clear, but could benefit from a warning about using automatic schema generation in production environments.

Comment on lines 43 to 57
quarkus.hibernate-orm.database.generation=update
```

#### For WildFly/Jakarta EE Servers

Create or update your `persistence.xml`:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="https://jakarta.ee/xml/ns/persistence" version="3.0">
<persistence-unit name="a2a-java" transaction-type="JTA">
<jta-data-source>java:jboss/datasources/A2ATasksDS</jta-data-source>

<class>io.a2a.extras.taskstore.database.jpa.JpaTask</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>

<properties>
<property name="jakarta.persistence.schema-generation.database.action" value="create"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of quarkus.hibernate-orm.database.generation=update and jakarta.persistence.schema-generation.database.action" value="create" is great for quick starts and development. However, it can be risky in production environments as it can lead to unintended schema modifications or data loss. It would be beneficial to add a note to the documentation recommending a more controlled schema migration strategy (like Flyway or Liquibase) for production use.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine but added a comment saying to adjust these properties for your environment

@fjuma fjuma merged commit 8dc6f2e into a2aproject:main Sep 25, 2025
4 checks passed
kabir added a commit to kabir/a2a-java that referenced this pull request Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: Implement a SQL based TaskStore

2 participants