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

Add spring sharding demo #308

Merged
merged 4 commits into from
Mar 7, 2024
Merged

Conversation

meedbek
Copy link
Contributor

@meedbek meedbek commented Feb 22, 2024

Adding a demo application demonstrating the use of the latest sharding feature in Spring Framework with the Oracle Database.

There are two versions one that uses JPA to access data in the database, and a second one that uses JdbcTemplate

Copy link
Contributor

@gvenzl gvenzl left a comment

Choose a reason for hiding this comment

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

Looks good for most of it, please check the couple of comments I've left in the files.

How will a user ever uninstall these samples? There is a tablespace being created, etc. Do we expect users just to destroy the entire sharded database environment after they run these sample applications or is there a need for an uninstall script that can be run that will clean up the environment?

java/jdbc/SpringSharding/JPA/README.md Outdated Show resolved Hide resolved
to learn how to set up and deploy an Oracle sharded database.
You can also refer to [Oracle Database Operator](https://github.com/oracle/oracle-database-operator) that makes deploying a sharded database on a Kubernetes Cluster an easy process.

After your sharded database is set, run the following SQL script on the shard catalog to create your tables.
Copy link
Contributor

Choose a reason for hiding this comment

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

As what database user are you supposed to run this script? There is no indication of that. Is it SYSTEM or the shard director user, or the catalog user, or are these all the same the user? It would probably help the user to be more specific on how to execute these DDLs and what user(s) to use in the properties.

Copy link
Contributor

Choose a reason for hiding this comment

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

After your sharded database is set, connect to the shard catalog as sysdba and create the demo application schema user.

@meedbek meedbek requested a review from gvenzl February 26, 2024 09:31
@jeandelavarene
Copy link
Contributor

Looks good for most of it, please check the couple of comments I've left in the files.

How will a user ever uninstall these samples? There is a tablespace being created, etc. Do we expect users just to destroy the entire sharded database environment after they run these sample applications or is there a need for an uninstall script that can be run that will clean up the environment?

@gvenzl this is what was added to address you comment:


To uninstall and clean up the preceding setup, you can connect as sysdba and run the following SQL script.

~~~SQL
ALTER SESSION ENABLE SHARD DDL;

DROP USER demo_user CASCADE;
DROP TABLESPACE SET TS1;
~~~

@gvenzl gvenzl merged commit 4e50178 into oracle-samples:main Mar 7, 2024
1 check passed
ibre5041 pushed a commit to ibre5041/oracle-db-examples that referenced this pull request Jun 19, 2024
* Add spring sharding demo

* Update database setup instructions

* Replace 2023 with 2024 in copyright header

---------

Co-authored-by: Gerald Venzl <[email protected]>
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.

3 participants