Compare commits

...
27 Commits
Author SHA1 Message Date
Rob Bygrave 1f9e652ea9 Version 16.0.0 2025-08-25 08:21:49 +12:00
Rob Bygrave 4e592c97ff Update how to deploy 2025-08-05 23:30:18 +12:00
Rob Bygrave 760d19a10d Update how to deploy 2025-08-05 23:16:42 +12:00
Rob Bygrave d2693c3ff2 Version 16.0.0-RC4 2025-08-05 23:15:20 +12:00
Rob Bygrave 3324b2bda4 Use autocommit false with findIterate for Postgres (#3662)
* Use autocommit false with findIterate for Postgres

* Use autocommit false with findIterate for Postgres

* Use autocommit false with FindDto queries for Postgres

* Use autocommit false with SqlQuery findIterate queries for Postgres

* Ensure that TransactionFactory.createReadOnlyTransaction() returns an ImplicitReadOnlyTransaction

This change changes TransactionFactoryTenant.createReadOnlyTransaction() to return a ImplicitReadOnlyTransaction, as that is now used to support Postgres use of cursors with findIterate style queries.
2025-08-05 23:03:28 +12:00
Rob Bygrave 1b5e066562 #3654 Fix querybean-generator compiler warning for unclaimed annotations (#3655)
warning: No processor claimed any of these annotations: /io.ebean.typequery.TypeQueryBean,/io.ebean.typequery.Generated

This fix is required when the compiler is run with -Werror specified

An alternative workaround is to use compiler arg -Xlint:-processing rather than -Xlint:all
2025-07-16 20:34:56 +12:00
Rob Bygrave 104e4ec756 Bump ebean-test-containers to 7.14 - Yugabyte read committed support enabled by default (#3651) 2025-07-14 09:03:39 +12:00
Rob Bygrave 74a2967a6e Tests Yugabyte - comment out the TestQueryForUpdate using repeatable read
... as its noise there is anyone else reads the logs
2025-07-12 09:38:06 +12:00
Rob Bygrave e693b12a97 Tests DB2 - ignore TestRawExpressionInterpolation for DB2 2025-07-12 09:30:16 +12:00
Rob Bygrave 48fb9b34bb Tests Yugabyte - faster test using forUpdate 2025-07-12 09:18:01 +12:00
Rob Bygrave f64400400a Tests Oracle - ignore the TestRawExpressionInterpolation for Oracle 2025-07-12 09:09:34 +12:00
Rob Bygrave d7cc081942 Tests Yugabyte - see if everything else passes 2025-07-12 09:04:02 +12:00
Rob Bygrave 3351548b60 Fix use of JSpecify Nullable annotation in query bean generation 2025-07-11 23:45:31 +12:00
Rob Bygrave 8d9858f57a Test only - Update logging for test TestQueryForUpdate 2025-07-11 23:35:03 +12:00
Rob Bygrave 9b520bc176 Bump avaje-config to 4.1 2025-07-11 23:22:16 +12:00
Rob Bygrave 44fd8e3a56 Adjust TestQueryForUpdate for Yugabyte - use markAsDirty on repeatable read test 2025-07-11 23:11:45 +12:00
Rob Bygrave 6910016c4d Adjust TestQueryForUpdate for Yugabyte - use markAsDirty
To see if the update has an impact on the 2nd thread waiting
2025-07-11 22:58:02 +12:00
Rob Bygrave 5f8a3c0591 Adjust TestQueryForUpdate for Yugabyte - check repeatable read isolation level 2025-07-11 22:05:31 +12:00
Rob Bygrave 0ae6956c1c Bump ebean-datasource 10.1 with support for initialConnections (#3650)
So in a K8s deployment, this adds support for having an initial number of connections to create initially (higher that min connections). This allows for a smoother deployment, by effectively having initially more connections than min in order to immediately take production load, and then over time trim back down towards the min connections.

So in k8s I am setting min, initial and max connections, where initial connections is high enough to take full production load straight after readiness true.
2025-07-11 21:26:58 +12:00
Rob Bygrave 2e9c5d8548 Merge branch 'query-cache-oom-for-too-large-beans' 2025-07-11 21:19:21 +12:00
Rob Bygrave 93edc840b3 Add a test that hits the new branch of code 2025-07-11 21:18:00 +12:00
Josiah NoelandRob Bygrave 34311785fa Fix Jackson NCDF Error (#3639)
* fix jackson NCDF error

split jackson SPI impl into it's own module

* Restore format

* Restore format

* Trim up dependencies

* Rename module to ebean-core-json

---------

Co-authored-by: Rob Bygrave <robin.bygrave@gmail.com>
2025-07-11 20:53:25 +12:00
Rob Bygrave 63929f8ff3 Bump test Yugabyte version to 2.20.11.0-b34 2025-07-11 20:26:12 +12:00
Jonas Fröhler d918c5117f no import changes 2025-07-01 09:05:48 +02:00
Jonas Fröhler dd845a7b0c Fix imports 2025-07-01 09:02:26 +02:00
Jonas Fröhler df0e4d57f0 Clean up 2025-06-27 12:17:19 +02:00
Jonas Fröhler 9c7fa25d49 Query Cache OOM test and potential draft for the fix 2025-06-27 12:14:01 +02:00
97 changed files with 671 additions and 407 deletions
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -22,13 +22,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -47,19 +47,19 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-net-postgis-types</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -22,13 +22,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -47,19 +47,19 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis-types</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -41,7 +41,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-mapper</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -60,13 +60,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<artifactId>composites</artifactId>
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<name>ebean api</name>
@@ -35,7 +35,7 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-config</artifactId>
<version>4.0</version>
<version>4.1</version>
</dependency>
<dependency>
@@ -167,6 +167,7 @@ public class DatabasePlatform {
* findIterate() and findVisit().
*/
protected boolean forwardOnlyHintOnFindIterate;
protected boolean autoCommitFalseOnFindIterate;
/**
* If set then use the CONCUR_UPDATABLE hint when creating ResultSets.
@@ -528,6 +529,10 @@ public class DatabasePlatform {
this.forwardOnlyHintOnFindIterate = forwardOnlyHintOnFindIterate;
}
public boolean autoCommitFalseOnFindIterate() {
return autoCommitFalseOnFindIterate;
}
/**
* Return true if the ResultSet CONCUR_UPDATABLE Hint should be used on
* createNativeSqlTree() PreparedStatements.
@@ -780,4 +785,5 @@ public class DatabasePlatform {
public String inlineSqlHint(String hint) {
return "/*+ " + hint + " */ ";
}
}
+26 -26
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<name>ebean bom</name>
@@ -89,25 +89,25 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -125,13 +125,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-mapper</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -155,37 +155,37 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-spring-txn</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<!-- platforms -->
@@ -193,79 +193,79 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-clickhouse</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-db2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-h2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-hana</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-mariadb</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-mysql</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-nuodb</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-oracle</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgres</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis-types</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-sqlite</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-sqlserver</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+32
View File
@@ -0,0 +1,32 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.ebean</groupId>
<artifactId>ebean-parent</artifactId>
<version>16.0.0</version>
</parent>
<artifactId>ebean-core-json</artifactId>
<name>ebean-core-json</name>
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>HEAD</tag>
</scm>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0</version>
</dependency>
<!-- Jackson core used internally by Ebean -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
</dependencies>
</project>
@@ -8,11 +8,7 @@ import io.ebean.service.SpiJsonService;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
/**
* Utility that converts between JSON content and simple java Maps/Lists.
@@ -52,8 +48,8 @@ public final class DJsonService implements SpiJsonService {
}
/**
* Parse the json and return as a Map additionally specifying if the returned map should
* be modify aware meaning that it can detect when it has been modified.
* Parse the json and return as a Map additionally specifying if the returned map should be modify
* aware meaning that it can detect when it has been modified.
*/
@Override
public Map<String, Object> parseObject(String json, boolean modifyAware) throws IOException {
@@ -94,9 +90,8 @@ public final class DJsonService implements SpiJsonService {
/**
* Parse the json and return as a Map taking a JsonParser and a starting token.
* <p>
* Used when the first token is checked to see if the value is null prior to calling this.
* </p>
*
* <p>Used when the first token is checked to see if the value is null prior to calling this.
*/
@Override
public Map<String, Object> parseObject(JsonParser parser, JsonToken token) throws IOException {
@@ -8,15 +8,23 @@ import io.ebean.ModifyAwareType;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.*;
final class EJsonReader {
static final JsonFactory json = new JsonFactory();
private final JsonParser parser;
private final boolean modifyAware;
private final ModifyAwareFlag modifyAwareOwner;
private int depth;
private Stack stack;
private Context currentContext;
EJsonReader(JsonParser parser, boolean modifyAware) {
this.parser = parser;
this.modifyAware = modifyAware;
this.modifyAwareOwner = modifyAware ? new ModifyAwareFlag() : null;
}
@SuppressWarnings("unchecked")
static Map<String, Object> parseObject(String json, boolean modifyAware) throws IOException {
@@ -102,24 +110,6 @@ final class EJsonReader {
return new EJsonReader(parser, modifyAware).parseJson(token);
}
private final JsonParser parser;
private final boolean modifyAware;
private final ModifyAwareFlag modifyAwareOwner;
private int depth;
private Stack stack;
private Context currentContext;
EJsonReader(JsonParser parser, boolean modifyAware) {
this.parser = parser;
this.modifyAware = modifyAware;
this.modifyAwareOwner = (modifyAware) ? new ModifyAwareFlag() : null;
}
private void startArray() {
depth++;
stack.push(currentContext);
@@ -197,7 +187,6 @@ final class EJsonReader {
*/
private void processJsonToken(JsonToken token) throws IOException {
switch (token) {
case START_ARRAY:
startArray();
break;
@@ -273,17 +262,17 @@ final class EJsonReader {
}
}
private static abstract class Context {
private abstract static class Context {
Context next;
abstract void popContext(Context temp);
abstract Object getValue();
abstract void setKey(String key);
abstract void setValue(Object value);
abstract void setKey(String key);
abstract void setValueNull();
}
@@ -312,13 +301,13 @@ final class EJsonReader {
}
@Override
void setKey(String key) {
this.key = key;
void setValue(Object value) {
map.put(key, value);
}
@Override
void setValue(Object value) {
map.put(key, value);
void setKey(String key) {
this.key = key;
}
@Override
@@ -364,5 +353,4 @@ final class EJsonReader {
// not expected
}
}
}
@@ -20,6 +20,11 @@ final class EJsonWriter {
* Base jsonFactory implementation used when it is not passed in.
*/
static final JsonFactory jsonFactory = new JsonFactory();
private final JsonGenerator jsonGenerator;
private EJsonWriter(JsonGenerator jsonGenerator) {
this.jsonGenerator = jsonGenerator;
}
static String write(Object object) throws IOException {
StringWriter writer = new StringWriter(200);
@@ -42,12 +47,6 @@ final class EJsonWriter {
new EJsonWriter(jsonGenerator).writeCollection(null, collection);
}
private final JsonGenerator jsonGenerator;
private EJsonWriter(JsonGenerator jsonGenerator) {
this.jsonGenerator = jsonGenerator;
}
private void writeJson(Object object) {
writeJson(null, object);
}
@@ -210,5 +209,4 @@ final class EJsonWriter {
}
jsonGenerator.writeEndObject();
}
}
@@ -22,5 +22,4 @@ public final class ModifyAwareFlag implements ModifyAwareType, Serializable {
public void setMarkedDirty(boolean markedDirty) {
this.markedDirty = markedDirty;
}
}
@@ -14,9 +14,8 @@ public final class ModifyAwareIterator<E> implements Iterator<E> {
/**
* Create with an Owner and the underlying Iterator this wraps.
* <p>
* The owner is notified of the removals.
* </p>
*
* <p>The owner is notified of the removals.
*/
public ModifyAwareIterator(ModifyAwareType owner, Iterator<E> it) {
this.owner = owner;
@@ -38,5 +37,4 @@ public final class ModifyAwareIterator<E> implements Iterator<E> {
owner.setMarkedDirty(true);
it.remove();
}
}
@@ -34,11 +34,11 @@ public final class ModifyAwareMap<K, V> implements Map<K, V>, ModifyAwareType, S
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof ModifyAwareMap) {
ModifyAwareMap<?,?> that = (ModifyAwareMap<?,?>) o;
ModifyAwareMap<?, ?> that = (ModifyAwareMap<?, ?>) o;
return Objects.equals(map, that.map);
}
if (!(o instanceof Map)) return false;
Map<?,?> that = (Map<?,?>) o;
Map<?, ?> that = (Map<?, ?>) o;
return Objects.equals(map, that);
}
@@ -112,7 +112,6 @@ public final class ModifyAwareMap<K, V> implements Map<K, V>, ModifyAwareType, S
map.putAll(m);
}
@Override
public void clear() {
if (!map.isEmpty()) {
@@ -135,5 +134,4 @@ public final class ModifyAwareMap<K, V> implements Map<K, V>, ModifyAwareType, S
public Set<Map.Entry<K, V>> entrySet() {
return new ModifyAwareSet<>(this, map.entrySet());
}
}
@@ -0,0 +1,9 @@
module io.ebean.core.json {
requires io.ebean.api;
requires transitive com.fasterxml.jackson.core;
exports io.ebeaninternal.json to io.ebean.test, io.ebean.core;
provides io.ebean.service.BootstrapService with io.ebeaninternal.json.DJsonService;
}
@@ -0,0 +1 @@
io.ebeaninternal.json.DJsonService
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<artifactId>ebean-core-type</artifactId>
@@ -16,7 +16,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
+12 -6
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<artifactId>ebean-core</artifactId>
@@ -22,7 +22,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-json</artifactId>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -46,7 +52,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -159,21 +165,21 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
@@ -1,5 +1,6 @@
package io.ebeaninternal.api;
import io.ebean.bean.EntityBean;
import java.util.ArrayList;
import java.util.List;
@@ -13,10 +14,23 @@ public final class BindValuesKey {
private final List<Object> values = new ArrayList<>();
private final SpiEbeanServer server;
public BindValuesKey(SpiEbeanServer server) {
this.server = server;
}
/**
* Add a bind value.
*/
public BindValuesKey add(Object value) {
if (value instanceof EntityBean) {
// only interested in id to keep the memory footprint low
Object id = server.beanId(value);
if (id != null) {
value = id;
}
}
values.add(value);
return this;
}
@@ -31,5 +45,4 @@ public final class BindValuesKey {
return values.hashCode();
}
}
@@ -362,4 +362,14 @@ public interface SpiTransaction extends Transaction {
* Set the transaction to be inactive via external transaction manager.
*/
void deactivateExternal();
/**
* Set autocommit to false for a findIterate query.
* <p>
* This is done for specific platforms that need it, in order to make
* use cursors to stream a large or unbounded query result to the client.
*/
default void setAutoCommitOnFindIterate() {
throw new UnsupportedOperationException();
}
}
@@ -1,7 +1,6 @@
package io.ebeaninternal.server.core;
import io.ebean.CancelableQuery;
import io.ebean.Transaction;
import io.ebean.util.JdbcClose;
import io.ebeaninternal.api.*;
import io.ebeaninternal.server.persist.Binder;
@@ -98,6 +97,13 @@ public abstract class AbstractSqlQueryRequest implements CancelableQuery {
public void setDefaultFetchBuffer(int fetchSize) {
query.setDefaultFetchBuffer(fetchSize);
}
public void setAutoCommitOnFindIterate() {
if (createdTransaction) {
transaction.setAutoCommitOnFindIterate();
}
}
/**
* Close the underlying resources.
*/
@@ -301,12 +301,12 @@ public final class InternalConfiguration {
}
DtoQueryEngine createDtoQueryEngine() {
return new DtoQueryEngine(binder, config.getJdbcFetchSizeFindEach(), config.getJdbcFetchSizeFindList());
return new DtoQueryEngine(binder, config.getJdbcFetchSizeFindEach(), config.getJdbcFetchSizeFindList(), databasePlatform.autoCommitFalseOnFindIterate());
}
RelationalQueryEngine createRelationalQueryEngine() {
return new DefaultRelationalQueryEngine(binder, config.getDatabaseBooleanTrue(), config.getPlatformConfig().getDbUuid().useBinaryOptimized(),
config.getJdbcFetchSizeFindEach(), config.getJdbcFetchSizeFindList());
config.getJdbcFetchSizeFindEach(), config.getJdbcFetchSizeFindList(), databasePlatform.autoCommitFalseOnFindIterate());
}
OrmQueryEngine createOrmQueryEngine() {
@@ -786,4 +786,10 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
beanDescriptor.freeze(bean);
}
}
public void setAutoCommitOnFindIterate() {
if (createdTransaction) {
transaction.setAutoCommitOnFindIterate();
}
}
}
@@ -37,12 +37,14 @@ public final class CQueryEngine {
private final CQueryBuilder queryBuilder;
private final CQueryHistorySupport historySupport;
private final DatabasePlatform dbPlatform;
private final boolean autoCommitFalseOnFindIterate;
public CQueryEngine(DatabaseBuilder.Settings config, DatabasePlatform dbPlatform, Binder binder, Map<String, String> asOfTableMapping, Map<String, String> draftTableMap) {
this.dbPlatform = dbPlatform;
this.defaultFetchSizeFindEach = config.getJdbcFetchSizeFindEach();
this.defaultFetchSizeFindList = config.getJdbcFetchSizeFindList();
this.forwardOnlyHintOnFindIterate = dbPlatform.forwardOnlyHintOnFindIterate();
this.autoCommitFalseOnFindIterate = dbPlatform.autoCommitFalseOnFindIterate();
this.historySupport = new CQueryHistorySupport(dbPlatform.historySupport(), asOfTableMapping, config.getAsOfSysPeriod());
this.queryBuilder = new CQueryBuilder(config, dbPlatform, binder, historySupport, new CQueryDraftSupport(draftTableMap));
}
@@ -181,6 +183,9 @@ public final class CQueryEngine {
if (defaultFetchSizeFindEach > 0) {
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
}
if (autoCommitFalseOnFindIterate) {
request.setAutoCommitOnFindIterate();
}
if (!cquery.prepareBindExecuteQueryForwardOnly(forwardOnlyHintOnFindIterate)) {
// query has been cancelled already
return null;
@@ -15,6 +15,8 @@ import io.ebeaninternal.server.core.RowReader;
import io.ebeaninternal.server.persist.Binder;
import jakarta.persistence.PersistenceException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
@@ -28,15 +30,18 @@ public final class DefaultRelationalQueryEngine implements RelationalQueryEngine
private final Binder binder;
private final String dbTrueValue;
private final boolean binaryOptimizedUUID;
private final boolean autoCommitFalseOnFindIterate;
private final TimedMetricMap timedMetricMap;
private final int defaultFetchSizeFindEach;
private final int defaultFetchSizeFindList;
public DefaultRelationalQueryEngine(Binder binder, String dbTrueValue, boolean binaryOptimizedUUID,
int defaultFetchSizeFindEach, int defaultFetchSizeFindList) {
int defaultFetchSizeFindEach, int defaultFetchSizeFindList,
boolean autoCommitFalseOnFindIterate) {
this.binder = binder;
this.dbTrueValue = dbTrueValue == null ? "true" : dbTrueValue;
this.binaryOptimizedUUID = binaryOptimizedUUID;
this.autoCommitFalseOnFindIterate = autoCommitFalseOnFindIterate;
this.timedMetricMap = MetricFactory.get().createTimedMetricMap("sql.query.");
this.defaultFetchSizeFindEach = defaultFetchSizeFindEach;
this.defaultFetchSizeFindList = defaultFetchSizeFindList;
@@ -61,13 +66,20 @@ public final class DefaultRelationalQueryEngine implements RelationalQueryEngine
return "Query threw SQLException:" + msg + " Query was:" + sql;
}
private <T> void prepareForIterate(RelationalQueryRequest request) throws SQLException {
if (defaultFetchSizeFindEach > 0) {
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
}
if (autoCommitFalseOnFindIterate) {
request.setAutoCommitOnFindIterate();
}
request.executeSql(binder, SpiQuery.Type.ITERATE);
}
@Override
public void findEach(RelationalQueryRequest request, RowConsumer consumer) {
try {
if (defaultFetchSizeFindEach > 0) {
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
}
request.executeSql(binder, SpiQuery.Type.ITERATE);
prepareForIterate(request);
request.mapEach(consumer);
request.logSummary();
@@ -82,10 +94,7 @@ public final class DefaultRelationalQueryEngine implements RelationalQueryEngine
@Override
public <T> void findEach(RelationalQueryRequest request, RowReader<T> reader, Predicate<T> consumer) {
try {
if (defaultFetchSizeFindEach > 0) {
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
}
request.executeSql(binder, SpiQuery.Type.ITERATE);
prepareForIterate(request);
while (request.next()) {
if (!consumer.test(reader.read())) {
break;
@@ -17,11 +17,13 @@ public final class DtoQueryEngine {
private final Binder binder;
private final int defaultFetchSizeFindEach;
private final int defaultFetchSizeFindList;
private final boolean autoCommitFalseOnFindIterate;
public DtoQueryEngine(Binder binder, int defaultFetchSizeFindEach, int defaultFetchSizeFindList) {
public DtoQueryEngine(Binder binder, int defaultFetchSizeFindEach, int defaultFetchSizeFindList, boolean autoCommitFalseOnFindIterate) {
this.binder = binder;
this.defaultFetchSizeFindEach = defaultFetchSizeFindEach;
this.defaultFetchSizeFindList = defaultFetchSizeFindList;
this.autoCommitFalseOnFindIterate = autoCommitFalseOnFindIterate;
}
public <T> List<T> findList(DtoQueryRequest<T> request) {
@@ -43,12 +45,19 @@ public final class DtoQueryEngine {
}
}
private <T> void prepareForIterate(DtoQueryRequest<T> request) throws SQLException {
if (defaultFetchSizeFindEach > 0) {
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
}
if (autoCommitFalseOnFindIterate) {
request.setAutoCommitOnFindIterate();
}
request.executeSql(binder, SpiQuery.Type.ITERATE);
}
public <T> QueryIterator<T> findIterate(DtoQueryRequest<T> request) {
try {
if (defaultFetchSizeFindEach > 0) {
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
}
request.executeSql(binder, SpiQuery.Type.ITERATE);
prepareForIterate(request);
return new DtoQueryIterator<>(request);
} catch (SQLException e) {
throw new PersistenceException(errMsg(e.getMessage(), request.getSql()), e);
@@ -57,10 +66,7 @@ public final class DtoQueryEngine {
public <T> void findEach(DtoQueryRequest<T> request, Consumer<T> consumer) {
try {
if (defaultFetchSizeFindEach > 0) {
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
}
request.executeSql(binder, SpiQuery.Type.ITERATE);
prepareForIterate(request);
while (request.next()) {
consumer.accept(request.readNextBean());
}
@@ -73,11 +79,8 @@ public final class DtoQueryEngine {
public <T> void findEach(DtoQueryRequest<T> request, int batchSize, Consumer<List<T>> consumer) {
try {
prepareForIterate(request);
List<T> buffer = new ArrayList<>();
if (defaultFetchSizeFindEach > 0) {
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
}
request.executeSql(binder, SpiQuery.Type.ITERATE);
while (request.next()) {
buffer.add(request.readNextBean());
if (buffer.size() >= batchSize) {
@@ -98,10 +101,7 @@ public final class DtoQueryEngine {
public <T> void findEachWhile(DtoQueryRequest<T> request, Predicate<T> consumer) {
try {
if (defaultFetchSizeFindEach > 0) {
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
}
request.executeSql(binder, SpiQuery.Type.ITERATE);
prepareForIterate(request);
while (request.next()) {
if (!consumer.test(request.readNextBean())) {
break;
@@ -1244,7 +1244,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
public final HashQuery queryHash() {
// calculateQueryPlanHash is called just after potential AutoTune tuning
// so queryPlanHash is calculated well before this method is called
BindValuesKey bindKey = new BindValuesKey();
BindValuesKey bindKey = new BindValuesKey(server);
queryBindKey(bindKey);
return new HashQuery(queryPlanKey, bindKey);
}
@@ -36,7 +36,7 @@ final class ImplicitReadOnlyTransaction implements SpiTransaction, TxnProfileEve
/**
* Set false when using autoCommit (as a performance optimisation for the read-only case).
*/
private final boolean useCommit;
private boolean useCommit;
private final TransactionManager manager;
private final SpiTxnLogger logger;
private final boolean logSql;
@@ -550,6 +550,16 @@ final class ImplicitReadOnlyTransaction implements SpiTransaction, TxnProfileEve
throw new IllegalStateException(notExpectedMessage);
}
@Override
public void setAutoCommitOnFindIterate() {
try {
connection.setAutoCommit(false);
useCommit = true;
} catch (SQLException e) {
throw new PersistenceException(e);
}
}
@Override
public void rollbackAndContinue() {
// do nothing
@@ -34,7 +34,7 @@ abstract class TransactionFactory {
/**
* Set the Transaction Isolation level if required.
*/
final SpiTransaction setIsolationLevel(SpiTransaction t, boolean explicit, int isolationLevel) {
final SpiTransaction setIsolationLevel(SpiTransaction t, int isolationLevel) {
if (isolationLevel > -1) {
Connection connection = t.internalConnection();
try {
@@ -39,8 +39,8 @@ class TransactionFactoryBasic extends TransactionFactory {
Connection connection = null;
try {
connection = dataSource.getConnection();
SpiTransaction t = create(explicit, connection);
return setIsolationLevel(t, explicit, isolationLevel);
SpiTransaction t = manager.createTransaction(explicit, connection);
return setIsolationLevel(t, isolationLevel);
} catch (PersistenceException ex) {
JdbcClose.close(connection);
throw ex;
@@ -49,8 +49,4 @@ class TransactionFactoryBasic extends TransactionFactory {
}
}
private SpiTransaction create(boolean explicit, Connection c) {
return manager.createTransaction(explicit, c);
}
}
@@ -25,26 +25,32 @@ class TransactionFactoryTenant extends TransactionFactory {
@Override
public SpiTransaction createReadOnlyTransaction(Object tenantId, boolean useMaster) {
return create(false, tenantId);
Connection connection = null;
try {
if (tenantId == null) {
tenantId = tenantProvider.currentId();
}
connection = dataSourceSupplier.readOnlyConnection(tenantId, useMaster);
return new ImplicitReadOnlyTransaction(manager, connection, tenantId);
} catch (PersistenceException ex) {
JdbcClose.close(connection);
throw ex;
} catch (SQLException ex) {
throw new PersistenceException(ex);
}
}
@Override
public final SpiTransaction createTransaction(boolean explicit, int isolationLevel) {
SpiTransaction t = create(explicit, null);
return setIsolationLevel(t, explicit, isolationLevel);
}
private SpiTransaction create(boolean explicit, Object tenantId) {
Connection connection = null;
try {
if (tenantId == null) {
// tenantId not set (by lazy loading) so get current tenantId
tenantId = tenantProvider.currentId();
}
Object tenantId = tenantProvider.currentId();
connection = dataSourceSupplier.connection(tenantId);
SpiTransaction transaction = manager.createTransaction(explicit, connection);
transaction.setTenantId(tenantId);
return transaction;
return setIsolationLevel(transaction, isolationLevel);
} catch (PersistenceException ex) {
JdbcClose.close(connection);
+2 -3
View File
@@ -31,6 +31,7 @@ module io.ebean.core {
requires io.ebean.types;
requires static io.avaje.jsr305x;
requires static io.ebean.core.json;
requires static com.fasterxml.jackson.annotation;
requires static com.fasterxml.jackson.core;
requires static com.fasterxml.jackson.databind;
@@ -49,7 +50,6 @@ module io.ebean.core {
exports io.ebeaninternal.api to io.ebean.ddl.generator, io.ebean.querybean, io.ebean.autotune, io.ebean.postgis, io.ebean.test, io.ebean.elastic, io.ebean.spring.txn, io.ebean.postgis.types;
exports io.ebeaninternal.api.json to io.ebean.test;
exports io.ebeaninternal.json to io.ebean.test;
exports io.ebeaninternal.server.autotune to io.ebean.autotune;
exports io.ebeaninternal.server.core to io.ebean.test, io.ebean.elastic;
exports io.ebeaninternal.server.core.bootup to io.ebean.test;
@@ -78,7 +78,6 @@ module io.ebean.core {
io.ebeaninternal.server.query.DFetchGroupService,
io.ebeaninternal.server.profile.DProfileLocationFactory,
io.ebeaninternal.server.rawsql.DRawSqlService,
io.ebeaninternal.server.profile.DMetricFactory,
io.ebeaninternal.json.DJsonService;
io.ebeaninternal.server.profile.DMetricFactory;
}
@@ -3,4 +3,3 @@ io.ebeaninternal.server.rawsql.DRawSqlService
io.ebeaninternal.server.query.DFetchGroupService
io.ebeaninternal.server.profile.DProfileLocationFactory
io.ebeaninternal.server.profile.DMetricFactory
io.ebeaninternal.json.DJsonService
@@ -70,7 +70,7 @@ public class RawExpressionTest extends BaseExpressionTest {
}
private BindValuesKey bindKey(RawExpression query) {
BindValuesKey bindValuesKey = new BindValuesKey();
BindValuesKey bindValuesKey = new BindValuesKey(spiEbeanServer());
query.queryBindKey(bindValuesKey);
return bindValuesKey;
}
@@ -1,19 +1,20 @@
package io.ebeaninternal.server.querydefn;
import io.ebeaninternal.api.BindValuesKey;
import io.ebeaninternal.server.deploy.BaseTest;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class BindValuesKeyTest {
public class BindValuesKeyTest extends BaseTest {
@Test
public void update_with_null() {
BindValuesKey hash = new BindValuesKey();
BindValuesKey hash = new BindValuesKey(spiEbeanServer());
hash.add(1).add(null).add("hello");
BindValuesKey hash2 = new BindValuesKey();
BindValuesKey hash2 = new BindValuesKey(spiEbeanServer());
hash2.add(1).add(null).add("hello");
assertThat(hash).isEqualTo(hash2);
@@ -22,13 +23,13 @@ public class BindValuesKeyTest {
@Test
public void notEqual() {
BindValuesKey hash = new BindValuesKey();
BindValuesKey hash = new BindValuesKey(spiEbeanServer());
hash.add(1).add(null).add("hello");
BindValuesKey hash2 = new BindValuesKey();
BindValuesKey hash2 = new BindValuesKey(spiEbeanServer());
hash2.add(1).add("hello");
BindValuesKey hash3 = new BindValuesKey();
BindValuesKey hash3 = new BindValuesKey(spiEbeanServer());
hash2.add(1).add(null);
assertThat(hash).isNotEqualTo(hash2);
@@ -139,7 +139,7 @@ public class DefaultOrmQueryTest extends BaseExpressionTest {
}
private BindValuesKey bindKey(DefaultOrmQuery<Order> query) {
BindValuesKey key = new BindValuesKey();
BindValuesKey key = new BindValuesKey(spiEbeanServer());
query.queryBindKey(key);
return key;
}
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<name>ebean ddl generation</name>
@@ -28,14 +28,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
@@ -65,7 +65,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
+3 -2
View File
@@ -3,18 +3,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ebean-jackson-mapper</artifactId>
<name>ebean-jackson-mapper</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<name>ebean net postgis types</name>
@@ -19,14 +19,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<!-- provided scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
@@ -54,7 +54,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<name>ebean postgis types</name>
@@ -19,14 +19,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<!-- provided scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
@@ -62,7 +62,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<name>ebean querybean</name>
@@ -17,7 +17,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
@@ -59,14 +59,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
@@ -80,7 +80,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<artifactId>ebean-redis</artifactId>
@@ -29,35 +29,35 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
+3 -3
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<artifactId>ebean-spring-txn</artifactId>
@@ -28,7 +28,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
@@ -77,7 +77,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<name>ebean test</name>
@@ -33,20 +33,20 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -149,14 +149,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-mapper</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
@@ -5,7 +5,7 @@ import io.ebean.test.containers.PostgresContainer;
public class StartPostgres {
public static void main(String[] args) {
PostgresContainer.builder("15")
PostgresContainer.builder("17")
.dbName("unit")
//.port(6432)
//.user("unit")
@@ -2,14 +2,15 @@ package org.tests.basic;
import io.ebean.*;
import io.ebean.annotation.Platform;
import io.ebean.annotation.TxIsolation;
import io.ebean.test.LoggedSql;
import io.ebean.xtest.BaseTestCase;
import io.ebean.xtest.ForPlatform;
import io.ebean.xtest.IgnorePlatform;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.EBasic;
import org.tests.model.basic.Order;
import org.tests.model.basic.ResetBasicData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tests.model.basic.*;
import java.util.List;
@@ -18,6 +19,8 @@ import static org.junit.jupiter.api.Assertions.*;
public class TestQueryForUpdate extends BaseTestCase {
private static final Logger log = LoggerFactory.getLogger(TestQueryForUpdate.class);
@Test
public void testForUpdate() {
@@ -41,54 +44,99 @@ public class TestQueryForUpdate extends BaseTestCase {
}
}
// Nah, nothing to do with repeatable read here
// @ForPlatform(Platform.YUGABYTE)
// @Test
// void concurrentForUpdate() throws InterruptedException {
// ResetBasicData.reset();
//
// Database db = DB.getDefault();
// Thread t1 = new Thread() {
// @Override
// public void run() {
// try (final Transaction transaction = db.createTransaction(TxIsolation.REPEATABLE_READ)) {
// log.info("(REPEATABLE_READ) Thread: before find");
// List<Country> list = DB.find(Country.class)
// .usingTransaction(transaction)
// .forUpdate()
// .findList();
//
// try {
// log.info("(REPEATABLE_READ) Thread: after find - size:{}, hold locks for some time", list.size());
// Thread.sleep(500);
// } catch (InterruptedException e) {
// throw new RuntimeException(e);
// }
// log.info("(REPEATABLE_READ) Thread: done, release locks");
// }
// }
// };
//
// t1.start();
// Thread.sleep(100);
//
// long start = System.currentTimeMillis();
// try (final Transaction transaction = db.createTransaction(TxIsolation.REPEATABLE_READ)) {
// log.info("(REPEATABLE_READ) Main: before find, should wait for locks to be released...");
// DB.find(Country.class)
// .usingTransaction(transaction)
// .forUpdate()
// .findList();
//
// log.info("(REPEATABLE_READ) Main: complete");
// }
//
// long exeMillis = System.currentTimeMillis() - start;
// assertThat(exeMillis).isGreaterThan(300);
// }
// @IgnorePlatform(Platform.YUGABYTE) // ignore this for yugabyte and see if everything else passes
@Test
public void testConcurrentForUpdate() throws InterruptedException {
ResetBasicData.reset();
Thread t1 = new Thread() {
@Override
public void run() {
try (final Transaction transaction = DB.beginTransaction()) {
System.out.println("Thread: before find");
DB.find(Customer.class)
.forUpdate()
// .orderBy().desc("1") // this would help by the locks in DB2
.findList();
Database db = DB.getDefault();
Thread t1 = new Thread(() -> {
try (final Transaction transaction = db.createTransaction()) {
log.info("Thread: before find");
List<Customer> list = DB.find(Customer.class)
.usingTransaction(transaction)
.forUpdate()
.findList();
System.out.println("Thread: after find");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
System.out.println("Thread: done");
try {
log.info("Thread: after find - rows locked:{}, hold for 700ms", list.size());
Thread.sleep(600); // 3000
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
};
log.info("Thread: done, releasing locks");
} // transaction ended here via try-with-resources
});
t1.start();
Thread.sleep(100);
long start = System.currentTimeMillis();
try (final Transaction transaction = DB.beginTransaction()) {
try (final Transaction transaction = db.beginTransaction()) { // second transaction
if (isH2()) {
DB.sqlUpdate("SET LOCK_TIMEOUT 5000").execute();
}
System.out.println("Main: before find");
log.info("Main: before find, should wait (blocked by other thread) ...");
DB.find(Customer.class)
.usingTransaction(transaction)
.forUpdate()
//.orderBy().desc("1") // this would help by the locks in DB2
.findList();
System.out.println("Main: after find");
}
start = System.currentTimeMillis() - start;
assertThat(start).isGreaterThan(2800);
log.info("Main: complete");
} // end second transaction
long exeMillis = System.currentTimeMillis() - start;
assertThat(exeMillis)
.describedAs("select for update expected to wait")
.isGreaterThan(400); // 2500
}
@Test
@@ -1,13 +1,16 @@
package org.tests.el;
import io.ebean.annotation.Platform;
import io.ebean.xtest.BaseTestCase;
import io.ebean.DB;
import io.ebean.Query;
import io.ebean.xtest.IgnorePlatform;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
class TestRawExpressionInterpolation extends BaseTestCase {
@IgnorePlatform({Platform.ORACLE, Platform.DB2})
@Test
void test() {
@@ -0,0 +1,21 @@
package org.tests.model.memleak;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
/**
* Class with @Cache(enableQueryCache = true)
*
* @author Jonas Fr&ouml;hler, FOCONIS AG
*/
@Entity
public class MemleakChild {
@Id
Long id;
String name;
transient byte[] memConsumer = new byte[1000000];
}
@@ -0,0 +1,25 @@
package org.tests.model.memleak;
import io.ebean.annotation.Cache;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
/**
* Class that holds the {@link MemleakChild}.
*
* @author Jonas Fr&ouml;hler, Foconis Analytics GmbH
*/
@Entity
@Cache(enableQueryCache = true)
public class MemleakParent {
@Id
Long id;
@ManyToOne()
MemleakChild child;
String name;
}
@@ -0,0 +1,37 @@
package org.tests.model.memleak;
import io.ebean.DB;
import io.ebean.xtest.BaseTestCase;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* The query cache holds the bean (MemleakChild). If there are "big" beans, then an OOM may occur.
*
* @author Jonas Fr&ouml;hler, Foconis Analytics GmbH
*/
public class TestQueryCacheHoldsBean extends BaseTestCase {
@Test
@Disabled("Run manually with -Xmx128M")
void testQueryCacheHoldsBean() {
for (long id = 0; id <= 1000; id++) {
DB.find(MemleakParent.class)
.where().eq("id", id)
.eq("child", DB.reference(MemleakChild.class, id))
.setUseQueryCache(true)
.findOne();
}
}
@Test
void queryCacheHoldsBean() {
var query = DB.find(MemleakParent.class)
.where().eq("id", 989898)
.eq("child", DB.reference(MemleakChild.class, 4534535))
.setUseQueryCache(true);
query.findOne();
query.findOne();
}
}
@@ -6,9 +6,11 @@ import org.tests.model.basic.EBasic.Status;
* DTO for Ebasic Queries.
*/
public class EBasicDto {
private Integer id;
private Integer id;
private Status status;
private String name;
private String description;
public Integer getId() {
return id;
@@ -25,4 +27,22 @@ public class EBasicDto {
public void setStatus(Status status) {
this.status = status;
}
}
public String getName() {
return name;
}
public EBasicDto setName(String name) {
this.name = name;
return this;
}
public String getDescription() {
return description;
}
public EBasicDto setDescription(String description) {
this.description = description;
return this;
}
}
@@ -6,7 +6,8 @@ import io.ebean.DB;
import io.ebean.Database;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.EBasic;
// import org.tests.model.basic.EBasic;
import org.tests.query.cancel.EBasicDto;
import javax.management.MBeanServer;
import java.io.File;
@@ -30,57 +31,50 @@ public class TestFindIterateHeapDump extends BaseTestCase {
*/
@Disabled
@Test
public void test() {
void test() {
Database server = DB.getDefault();
// Transaction transaction = server.beginTransaction();
// try {
// String desc = "0123456789".repeat(20);
// try (Transaction transaction = server.beginTransaction()){
// transaction.setBatchMode(true);
// transaction.setBatchSize(20);
// for (int i = 0; i < 20000; i++) {
// transaction.setBatchSize(100);
// for (int i = 0; i < 200_000; i++) {
// EBasic dumbModel = new EBasic();
// dumbModel.setName("Goodbye now");
// dumbModel.setDescription(desc);
// server.save(dumbModel);
// }
// transaction.commit();
//
// } finally {
// transaction.end();
// }
//
// if (true) {
// return;
// }
// Intentionally not iterating through the iterator to
final AtomicInteger counter = new AtomicInteger();
server.find(EBasic.class)
.findEach(bean -> {
server.sqlQuery("select id, status, name, description from e_basic")
.findEach(bean -> {
// server.findDto(EBasicDto.class, "select id, status, name, description from e_basic")
// .findStream().forEach(bean -> {
// server.find(EBasic.class)
// .findEach(bean -> {
// server.find(EBasic.class)
// .setBufferFetchSizeHint(10)
// .findStream().forEach(bean -> {
// .findEach(bean -> {
int count = counter.incrementAndGet();
if (count == 1) {
dumpHeap("heap-dump13-initial.snapshot", true);
if (count == 10) {
dumpHeap("s1-dump-initial.snapshot.hprof", true);
}
if (count == (200_000 - 100)) {
dumpHeap("s1-dump-end.snapshot.hprof", true);
}
});
// try {
// while (iterate.hasNext()) {
// EBasic eBasic = iterate.next();
// eBasic.getDescription();
// }
// } finally {
// iterate.close();
// }
String fileName = "heap-dump13.snapshot";
String fileName = "s1-dump.snapshot.hprof";
File file = new File(fileName);
if (file.exists())
if (file.exists()) {
file.delete();
}
dumpHeap(fileName, true);
}
@@ -1,5 +1,5 @@
ebean.test.platform=yugabyte
datasource.default=yugabyte
ebean.test.dbName=unit
ebean.test.yugabyte.version=2.18.0.0-b65
ebean.test.yugabyte.version=2.20.11.0-b34
ebean.lengthCheck=on
+4 -4
View File
@@ -15,8 +15,8 @@ mvn -T 4 clean package
mvn -T 4 deploy -pl '!composites,!platforms' -Pcentral -DskipTests
## git commit, git tag, git push --tags
git commit -am 'Version 16.0.0-rc3'
git tag 16.0.0-rc3
git commit -am 'Version 16.0.0'
git tag 16.0.0
git push --tags
## convert to javax
@@ -27,7 +27,7 @@ mvs
## deploy javax
mvn -T 4 clean package
mvn -T 4 deploy -pl '!composites,!platforms' -Pcentral -DskipTests -DskipStagingRepositoryClose=true -DstagingProgressTimeoutMinutes=9
mvn -T 4 deploy -pl '!composites,!platforms' -Pcentral -DskipTests
## checkout / cleanup
git checkout .
@@ -45,7 +45,7 @@ mvs
## build and deploy 15.x
mvn -T 4 clean package
mvn -T 4 deploy -pl '!composites,!platforms' -Pcentral -DskipTests -DskipStagingRepositoryClose=true -DstagingProgressTimeoutMinutes=9
mvn -T 4 deploy -pl '!composites,!platforms' -Pcentral -DskipTests
```
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<name>kotlin querybean generator</name>
@@ -21,7 +21,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
@@ -35,7 +35,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
@@ -56,14 +56,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
@@ -5,6 +5,9 @@ interface Constants {
String AT_GENERATED = "@io.ebean.typequery.Generated(\"io.ebean.querybean.kotlin-generator\")";
String AT_TYPEQUERYBEAN = "@io.ebean.typequery.TypeQueryBean(\"v1\")";
String GENERATED = "io.ebean.typequery.Generated";
String TYPEQUERYBEAN = "io.ebean.typequery.TypeQueryBean";
String MAPPED_SUPERCLASS = "jakarta.persistence.MappedSuperclass";
String DISCRIMINATOR_VALUE = "jakarta.persistence.DiscriminatorValue";
String INHERITANCE = "jakarta.persistence.Inheritance";
@@ -24,6 +27,6 @@ interface Constants {
String METAINF_MANIFEST = "META-INF/ebean-generated-info.mf";
String METAINF_SERVICES_MODULELOADER = "META-INF/services/io.ebean.config.EntityClassRegister";
String AVAJE_LANG_NULLABLE = "io.avaje.lang.Nullable";
String AVAJE_LANG_NULLABLE = "org.jspecify.annotations.Nullable";
String JAVA_COLLECTION = "java.util.Collection";
}
@@ -49,6 +49,8 @@ public class Processor extends AbstractProcessor implements Constants {
annotations.add(CONVERTER);
annotations.add(EBEAN_COMPONENT);
annotations.add(MODULEINFO);
annotations.add(TYPEQUERYBEAN);
annotations.add(GENERATED);
return annotations;
}
+15 -14
View File
@@ -4,78 +4,79 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-all</artifactId>
<name>ebean-platform-all</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hsqldb</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlanywhere</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-clickhouse</artifactId>
<name>ebean-platform-clickhouse</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-db2</artifactId>
<name>ebean-platform-db2</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-h2</artifactId>
<name>ebean-platform-h2</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<!-- Provided scope so that the H2HistoryTrigger can live in Ebean core
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-hana</artifactId>
<name>ebean-platform-hana</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-hsqldb</artifactId>
<name>ebean-platform-hsqldb</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+4 -3
View File
@@ -4,24 +4,25 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-mariadb</artifactId>
<name>ebean-platform-mariadb</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-mysql</artifactId>
<name>ebean-platform-mysql</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-nuodb</artifactId>
<name>ebean-platform-nuodb</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-oracle</artifactId>
<name>ebean-platform-oracle</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+2 -1
View File
@@ -4,10 +4,11 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<artifactId>platforms</artifactId>
<name>platforms</name>
<packaging>pom</packaging>
<modules>
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-postgres</artifactId>
<name>ebean-platform-postgres</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -35,6 +35,7 @@ public class PostgresPlatform extends DatabasePlatform {
this.blobDbType = Types.LONGVARBINARY;
this.clobDbType = Types.VARCHAR;
this.nativeUuidType = true;
this.autoCommitFalseOnFindIterate = true;
this.truncateTable = "truncate table %s cascade";
this.dbEncrypt = new PostgresDbEncrypt();
this.historySupport = new PostgresHistorySupport();
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-sqlanywhere</artifactId>
<name>ebean-platform-sqlanywhere</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-sqlite</artifactId>
<name>ebean-platform-sqlite</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+3 -2
View File
@@ -4,18 +4,19 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>ebean-platform-sqlserver</artifactId>
<name>ebean-platform-sqlserver</name>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
</dependencies>
+4 -3
View File
@@ -9,7 +9,7 @@
<groupId>io.ebean</groupId>
<artifactId>ebean-parent</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<packaging>pom</packaging>
<name>ebean parent</name>
@@ -48,8 +48,8 @@
<ebean-ddl-runner.version>2.3</ebean-ddl-runner.version>
<ebean-migration-auto.version>1.2</ebean-migration-auto.version>
<ebean-migration.version>14.2.0</ebean-migration.version>
<ebean-test-containers.version>7.13</ebean-test-containers.version>
<ebean-datasource.version>10.0</ebean-datasource.version>
<ebean-test-containers.version>7.14</ebean-test-containers.version>
<ebean-datasource.version>10.1</ebean-datasource.version>
<ebean-agent.version>14.12.0</ebean-agent.version>
<ebean-maven-plugin.version>14.12.0</ebean-maven-plugin.version>
<surefire.useModulePath>false</surefire.useModulePath>
@@ -97,6 +97,7 @@
<module>ebean-jackson-mapper</module>
<module>ebean-spring-txn</module>
<module>kotlin-querybean-generator</module>
<module>ebean-core-json</module>
</modules>
<profiles>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<name>querybean generator</name>
@@ -4,6 +4,7 @@ interface Constants {
String AT_GENERATED = "@io.ebean.typequery.Generated(\"io.ebean.querybean.generator\")";
String AT_TYPEQUERYBEAN = "@io.ebean.typequery.TypeQueryBean(\"v1\")";
String TYPEQUERYBEAN = "io.ebean.typequery.TypeQueryBean";
String GENERATED = "io.ebean.typequery.Generated";
String ONE_TO_MANY = "jakarta.persistence.OneToMany";
@@ -25,7 +26,7 @@ interface Constants {
String METAINF_MANIFEST = "META-INF/ebean-generated-info.mf";
String METAINF_SERVICES_MODULELOADER = "META-INF/services/io.ebean.config.EntityClassRegister";
String AVAJE_LANG_NULLABLE = "io.avaje.lang.Nullable";
String AVAJE_LANG_NULLABLE = "org.jspecify.annotations.Nullable";
String JAVA_COLLECTION = "java.util.Collection";
String EXPRESSIONLIST = "io.ebean.ExpressionList";
String EXPR = "io.ebean.Expr";
@@ -36,6 +36,8 @@ public class Processor extends AbstractProcessor implements Constants {
annotations.add(CONVERTER);
annotations.add(EBEAN_COMPONENT);
annotations.add(MODULEINFO);
annotations.add(TYPEQUERYBEAN);
annotations.add(GENERATED);
return annotations;
}
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<artifactId>tests</artifactId>
+4 -4
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>tests</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<artifactId>test-java16</artifactId>
@@ -18,7 +18,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-h2</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -30,14 +30,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>provided</scope>
</dependency>
+3 -3
View File
@@ -6,7 +6,7 @@
<parent>
<artifactId>tests</artifactId>
<groupId>io.ebean</groupId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</parent>
<artifactId>test-kotlin</artifactId>
@@ -40,7 +40,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
</dependency>
<dependency>
@@ -53,7 +53,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>16.0.0-RC3</version>
<version>16.0.0</version>
<scope>test</scope>
</dependency>