In RDBDocumentStoreDB:
public String getTableCreationStatement(String tableName, int schema) {
return "create table " + tableName
+ " (ID varchar(512) not null primary key, MODIFIED bigint,
HASBINARY smallint, DELETEDONCE smallint, MODCOUNT bigint, CMODCOUNT bigint,
DSIZE bigint, "
+ (schema >= 1 ? "VERSION smallint, " : "")
+ (schema >= 2 ? "SDTYPE smallint, SDMAXREVTIME bigint, " : "")
+ "DATA varchar(16384), BDATA blob(" + 1024 * 1024 * 1024 + "))";
But using utf8mb4 that DATA becomes 16384 * 4 = 65536, in mariadb the varchar
max is 65,532. The effective maximum length of a VARCHAR is subject to the
maximum row size and the character set used
MySql behaves the same so I can't understand the suggestion in using utf8mb4
given that create table statement, could you explain please?
Thanks
Cordiali saluti / Best regards,
Raffaele Gambelli
Senior Java Developer
E [email protected]<mailto:[email protected]>
[CEGEKA] Via Ettore Cristoni, 84
IT-40033 Bologna (IT),Italy
T +39 02 2544271
WWW.CEGEKA.COM<https://www.cegeka.com/>
[https://2655225.fs1.hubspotusercontent-na1.net/hubfs/2655225/0.0%20Cegeka%20(new)/1.%20Visuals/Email%20Signatures/Annual_Report_Visuals_2023_Email%20Banner%201.png]<https://www.cegeka.com/it/annual-report-2023?utm_campaign=[EN]%20-%20Annual%20Report%202023&utm_source=email%20signature%20banner&utm_medium=email%20signature%20banner%20annual%20report%202023>
Dichiarazione di Riservatezza
Le informazioni contenute nella mail sono riservate. Se si rende conto di non
essere il destinatario corretto della mail, la preghiamo di segnalare l'errore
al mittente e di cancellare immediatamente il messaggio. L’utilizzo improprio
di informazioni riservate può comportare sanzioni.
Protezione dei dati personali
La informiamo che i suoi dati saranno trattati da Cegeka nel rispetto delle
disposizioni di legge applicabili (D. Lgs 196/2003 e Regolamento UE 679/2016).
Per maggiori dettagli può consultare le nostre informative privacy al link
https://www.cegeka.com/it/informazioni-sulla-privacy.<https://www.cegeka.com/it/informazioni-sulla-privacy>
________________________________
From: Raffaele Gambelli <[email protected]>
Sent: Sunday, September 29, 2024 5:53 PM
To: [email protected] <[email protected]>
Subject: Problems in using RDB DocumentStore on mariadb
Hi all,
I'm testing my code either with jackrabbit 2.x on mariadb or oak on mongodb,
both with filedatastore.
I've found executing benchmarks that oak with mongo is really slow compared to
jackrabbit, so I wanted test oak with mariadb, I'm not able to do it working,
when I try I see in logs:
2024.09.29 17:31:27.293 - *ERROR* [main] o.a.j.o.p.d.rdb.RDBDocumentStoreDB: DB
type MariaDB unknown, trying default settings (getValue in
RDBDocumentStoreDB.java, line 903)
2024.09.29 17:32:30.450 - *ERROR* [main] o.a.j.o.p.d.rdb.RDBDocumentStore:
Unknown database type: MariaDB (initialize in RDBDocumentStore.java, line 1044)
As jdbc url I use:
<connectionURL>jdbc:mariadb://localhost:3306/arpav</connectionURL>
<driver>org.mariadb.jdbc.Driver</driver>
and mariadb-java-client as jdbc driver and RDBDocumentNodeStoreBuilder in this
way:
HikariDataSource ds = new HikariDataSource();
ds.setMaximumPoolSize(20);
ds.setDriverClassName(storagePersistenceDriver);
ds.setJdbcUrl(storagePersistenceConnectionURL);
ds.addDataSourceProperty("user", storagePersistenceUsername);
ds.addDataSourceProperty("password", storagePersistencePassword);
ds.setAutoCommit(false);
RDBDocumentNodeStoreBuilder rdbnsb = new RDBDocumentNodeStoreBuilder();
rdbnsb.setRDBConnection(ds);
but the main issues start during table creation... I'm using "CHARACTER SET
utf8mb4 COLLATE utf8mb4_unicode_ci" as suggested here
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fjackrabbit.apache.org%2Foak%2Fdocs%2Fnodestore%2Fdocument%2Frdb-document-store.html&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ce6e4db1937a6473463a108dce09ee2e6%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638632220236813295%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=2E6Aggni089yLaOesKDxDw7MmYFdrEYymsr0R%2FPBlBo%3D&reserved=0<https://jackrabbit.apache.org/oak/docs/nodestore/document/rdb-document-store.html>
2024.09.29 17:51:35.549 - *WARN * [main] o.m.jdbc.message.server.ErrorPacket:
Error: 1074-42000: Column length too big for column 'DATA' (max = 16383); use
BLOB or TEXT instead (warn in Slf4JLogger.java, line 99)
2024.09.29 17:51:35.549 - *ERROR* [main] o.a.j.o.p.d.rdb.RDBDocumentStore:
Failed to create table 'CLUSTERNODES' in 'MariaDB - using default settings
(jdbc:mariadb://localhost/default_tenant?user=default_tenant&password=***)'
(createTableFor in RDBDocumentStore.java, line 1401)
java.sql.SQLSyntaxErrorException: (conn=4) Column length too big for column
'DATA' (max = 16383); use BLOB or TEXT instead
at
org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:289)
at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:378)
at org.mariadb.jdbc.message.ClientMessage.readPacket(ClientMessage.java:172)
at
org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:915)
at
org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:854)
at
org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:773)
at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:697)
at org.mariadb.jdbc.Statement.executeInternal(Statement.java:1035)
Have you some hint in using MariaDb?
I've tried specifying jdbcurl MySql style but the driver of mariadb rejects it.
Thanks
Cordiali saluti / Best regards,
Raffaele Gambelli
Senior Java Developer
E [email protected]<mailto:[email protected]>
[CEGEKA] Via Ettore Cristoni, 84
IT-40033 Bologna (IT),Italy
T +39 02 2544271
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ce6e4db1937a6473463a108dce09ee2e6%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638632220236833023%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=qYpzARi2%2B6RnoFRLvZtLgyv9I9IpSvGU1B3gBHQaSZ4%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ce6e4db1937a6473463a108dce09ee2e6%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638632220236843796%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=z1DCCQiYNgaE57OYDS4J3WnoQn5CY0qEmpA8PPWWmww%3D&reserved=0><http://www.cegeka.com/>
[https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2F2655225.fs1.hubspotusercontent-na1.net%2Fhubfs%2F2655225%2F0.0%2520Cegeka%2520&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ce6e4db1937a6473463a108dce09ee2e6%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638632220236854020%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=ZU5vloRVKSo2Q6oKf5vnl1lUYcPTdA%2BzkK30Qc9Mimo%3D&reserved=0(new)/1.%20Visuals/Email%20Signatures/Annual_Report_Visuals_2023_Email%20Banner%201.png]<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cegeka.com%2Fit%2Fannual-report-2023%3Futm_campaign%3D&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ce6e4db1937a6473463a108dce09ee2e6%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638632220236864446%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=foiCaLqVaLIOtwjZT9kVmn09Bgv54cfZ2%2Fksp18c1WY%3D&reserved=0[EN]%20-%20Annual%20Report%202023&utm_source=email%20signature%20banner&utm_medium=email%20signature%20banner%20annual%20report%202023<https://2655225.fs1.hubspotusercontent-na1.net/hubfs/2655225/0.0%20Cegeka%20>>
Dichiarazione di Riservatezza
Le informazioni contenute nella mail sono riservate. Se si rende conto di non
essere il destinatario corretto della mail, la preghiamo di segnalare l'errore
al mittente e di cancellare immediatamente il messaggio. L’utilizzo improprio
di informazioni riservate può comportare sanzioni.
Protezione dei dati personali
La informiamo che i suoi dati saranno trattati da Cegeka nel rispetto delle
disposizioni di legge applicabili (D. Lgs 196/2003 e Regolamento UE 679/2016).
Per maggiori dettagli può consultare le nostre informative privacy al link
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cegeka.com%2Fit%2Finformazioni-sulla-privacy&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ce6e4db1937a6473463a108dce09ee2e6%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638632220236874686%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=SS6ya5h7PnR%2BYf6NLjgHUoCxCUbV0VHouxMDVxXem9Y%3D&reserved=0.<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cegeka.com%2Fit%2Finformazioni-sulla-privacy&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ce6e4db1937a6473463a108dce09ee2e6%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638632220236884919%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=6PCl7yIjsJRtQnd3Ll5dnZsIPtSdf3u0tcjBQyRR%2Fo0%3D&reserved=0><https://www.cegeka.com/it/informazioni-sulla-privacy>