Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the need for the eventsourcing_sequence table? #81

Closed
vab2048 opened this issue May 28, 2022 · 2 comments
Closed

What is the need for the eventsourcing_sequence table? #81

vab2048 opened this issue May 28, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@vab2048
Copy link

vab2048 commented May 28, 2022

@JohT Thanks for the repo :) I am using it for inspiration for my own exploration into the Axon framework here.

A question: in the SQL schema there are the lines:

CREATE TABLE "axon_on_microprofile_tryout"."eventsourcing_sequence" (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT NUMERIC(38), PRIMARY KEY (SEQ_NAME));

INSERT INTO "axon_on_microprofile_tryout"."eventsourcing_sequence"(SEQ_NAME, SEQ_COUNT) values ('ASSOCIATIONVALUEENTRY_ID', 0);
INSERT INTO "axon_on_microprofile_tryout"."eventsourcing_sequence"(SEQ_NAME, SEQ_COUNT) values ('DOMAINEVENTENTRY_GLOBAL_INDEX', 0);

I'm not sure I understand what exactly this is used for? Could you please explain?

@JohT JohT added the question Further information is requested label May 28, 2022
@JohT
Copy link
Owner

JohT commented May 28, 2022

I assume that this sequence table comes from JPA as a cause of @GeneratedValue inside AxonFramework JPA Entities. I once used Axon's JPA integration and configured it so that it generated the schema for me as a file.

I later switched to JDBC and used the generated SQL schema to get started. I've found AxonFramework/cdi/issues/9](AxonFramework/cdi#9 (comment)) where the sequence shows up in a log too.

I'll try what happens when I drop the eventsourcing_sequence and let you know.

And btw. nice to hear that this showcase helps you building your exploration of Axon. :-)

@JohT JohT added enhancement New feature or request and removed question Further information is requested labels May 28, 2022
@JohT JohT self-assigned this May 28, 2022
JohT added a commit that referenced this issue May 28, 2022
Drop unnecessary sequence table in database schema (issue #81)
@JohT
Copy link
Owner

JohT commented May 28, 2022

I've created the new database schema version v3.0.0 and dropped the sequence table there. It wasn't used and everything works fine without it. I've also added some comments in V1.0.0__AxonOnMicroprofileTryoutEventsourcing.sql for future reference.

Thank you for your hint. 👍

I'll close this issue, but don't hesitate to add further comments.

@JohT JohT closed this as completed May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants