Open DobryDobry opened 3 years ago
StaticAssertStmt(sizeof(SubTransactionId) <= sizeof(jint), ...)
Well that's peculiar. In the community PostgreSQL 13, SubTransactionId
is a typedef for uint32
. It is still uint32
even in community PostgreSQL 14.
Has Postgres PRO EE 13 redefined it to a wider type? Can you check how it is defined in /opt/pgpro/ent-13/include/server/c.h
?
The Java jint
type shouldn't have changed; that is fixed at 32 bits in the Java Language Specification.
So it seems either PostgresPRO must have increased the width of SubTransactionId
, or the C compiler is getting sizeof
or StaticAssertStmt
wrong, or there is some kind of header file confusion going on.
Thanks for your answer.
Has Postgres PRO EE 13 redefined it to a wider type? Can you check how it is defined in /opt/pgpro/ent-13/include/server/c.h ?
Yes, you are right. In /opt/pgpro/ent-13/include/server/c.h
i found:
typedef uint32 ShortTransactionId;
typedef uint64 LocalTransactionId;
typedef uint64 SubTransactionId;
What can i do with it?
It won't be completely trivial, as it will require corresponding changes in some of the C and Java code of PL/Java.I should review what the PL/Java subtransaction listener API currently exposes, to make sure a change doesn't break existing users' code.
Related discussion opened on pgsql-hackers.
I am getting back to this issue. Would you be able to look in the Postgres Pro include/access/xact.h
file and confirm that it still has the same function prototypes for these functions?
extern SubTransactionId GetCurrentSubTransactionId(void);
...
extern void BeginInternalSubTransaction(const char *name);
extern void ReleaseCurrentSubTransaction(void);
extern void RollbackAndReleaseCurrentSubTransaction(void);
(In the source I linked, those last three are on lines 415-417.) Also that the typedef
for SubXactCallback
still looks like this?
typedef void (*SubXactCallback) (SubXactEvent event, SubTransactionId mySubid,
SubTransactionId parentSubid, void *arg);
Thanks!
Hi, @jcflack!
I have the same problem with 64-bit transaction id in Postgres Pro EE 13. Answering your previous question (btw, header xact.h is on another path - .../include/server/access/):
Can you help me with using pl/java with 64-bit transaction ids? Is there a workaround?
Thank you!
Hi! Do you have any ideas?
$ java -version openjdk version "17.0.1" 2021-10-19 LTS OpenJDK Runtime Environment (build 17.0.1+12-LTS) OpenJDK 64-Bit Server VM (build 17.0.1+12-LTS, mixed mode, sharing)
$ javac -version javac 17.0.1
$ mvn -version Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739) Maven home: /home/sysadmin/pg_pljava_extension/apache-maven-3.8.3 Java version: 17.0.1, vendor: BellSoft, runtime: /usr/lib/jvm/bellsoft-java17-amd64 Default locale: ru_RU, platform encoding: UTF-8 OS name: "linux", version: "4.15.3-141-generic", arch: "amd64", family: "unix"
$ gcc --version gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
OS: Astra Linux CE 2.12 DB: Postgres PRO EE 13 PL/Java: 1.6.3