You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: devdoc/jdp/work-in-progress/wip-experimental-reimplementation-of-callable-statement.adoc
+54-2Lines changed: 54 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
= work-in-progress: Experimental reimplementation of CallableStatement
2
2
3
-
// SPDX-FileCopyrightText: Copyright 2024-2025 Mark Rotteveel
3
+
// SPDX-FileCopyrightText: Copyright 2024-2026 Mark Rotteveel
4
4
// SPDX-License-Identifier: LicenseRef-PDL-1.0
5
5
6
6
== Status
@@ -29,8 +29,60 @@ Previous attempts to address some of these issues, uncovered other problems or c
29
29
30
30
== Decision
31
31
32
+
We'll reimplement `java.sql.CallableStatement`.
33
+
This reimplementation will live next to the old implementation, and can be enabled with a connection property (see <<consequences>>) in Jaybird 7 for evaluation.
34
+
In Jaybird 8, or possibly later, it'll become the default, but the old implementation can still be enabled.
35
+
Eventually, the old implementation may be removed (at least one version after the new one becomes the default).
36
+
37
+
The exact feature set of the new implementation will be subject to further JDPs, but at least the following will be done:
38
+
39
+
* Only the JDBC call-escape will be transformed to selectable (`SELECT ... FROM <some-procedure>`) or executable procedure (`EXECUTE PROCEDURE <some-procedure>`).
40
+
** `SELECT ... FROM <some-procedure>` will *never* be transformed to `EXECUTE PROCEDURE <some-procedure>` or `CALL <some-procedure>`.
41
+
** `EXECUTE PROCEDURE <some-procedure>` will *never* be transformed to `SELECT * FROM <some-procedure>` or `CALL <some-procedure>`.
42
+
** Firebird 6+ `CALL <some-procedure>` will *never* be transformed to `EXECUTE PROCEDURE <some-procedure>` nor `SELECT * FROM <some-procedure>`.
43
+
* (_tentative_) Any other statement type will be executable as if it is a `PreparedStatement`.
44
+
+
45
+
This is tentative, as we'll need to double-check how this meshes with other requirements for `CallableStatement`.
46
+
* (_tentative_) Revise stored procedure `DatabaseMetaData` information reported for input and output parameters/result set.
47
+
+
48
+
This will likely be subject to a further JDP.
49
+
* The JDBC escape `++{?=CALL <proc> (...)}++` will only be allowed for stored procedures with a single OUT parameter, and even then use of `++{CALL <proc> (..., ?)}++` is recommended and preferred.
50
+
* Mixing input and output parameters will not be supported for the JDBC call escape and `EXECUTE PROCEDURE`.
51
+
+
52
+
Given this is a breaking change, we will evaluate if this is the right way to go, and maybe add support for mixing in later.
53
+
+
54
+
** No IN/OUT mapping (treating a parameter both as input and output parameter)
55
+
** No interleaving IN parameters and OUT parameters.
56
+
+
57
+
Either all IN comes first, followed by all OUT, except for a single output parameter executable procedures iff used with escape `++{?=CALL ...}++` (then first one OUT, then all IN).
58
+
* No output parameter mapping for selectable stored procedures.
59
+
60
+
We recognize that some of these are breaking changes compared to the current implementation.
61
+
We think this will avoid some of the complexity and hidden bugs in the current implementation, and make it more straightforward to use.
62
+
However, we will evaluate during development -- and after release of the experimental version in Jaybird 7 -- if we should reintroduce some of those options.
63
+
64
+
[#consequences]
32
65
== Consequences
33
66
67
+
Jaybird 7 will add a new callable statement implementation, tentatively named `FBCallableStatementV2`.
68
+
The original implementation, `FBCallableStatement` will remain the default in Jaybird 7.
69
+
70
+
A new connection property `callableImplementation` will be added with the following values (case-insensitive):
71
+
72
+
[horizontal.compact]
73
+
`v1`::
74
+
Use original implementation, `FBCallableStatement`
75
+
`v2`::
76
+
Use new -- experimental -- implementation, `FBCallableStatementV2`, and other associated changes (like `DatabaseMetaData` information)
77
+
78
+
A system property, `org.firebirdsql.jdbc.callableImplementation` will be added to configure a global default.
79
+
This will be checked at time of configuration creation.
80
+
81
+
* With Jaybird 7, the default is `v1`.
82
+
* With Jaybird 8, the default will change to `v2`;
83
+
it will then no longer be experimental
84
+
* With Jaybird 9 at the earliest, `v1` will be removed.
85
+
34
86
[appendix]
35
87
== License Notice
36
88
@@ -39,7 +91,7 @@ you may only use this Documentation if you comply with the terms of this License
39
91
A copy of the License is available at https://firebirdsql.org/en/public-documentation-license/.
40
92
41
93
The Original Documentation is "`work-in-progress: Experimental reimplementation of CallableStatement`".
0 commit comments