microstream-one / bookstore-demo-performance Goto Github PK
View Code? Open in Web Editor NEWMicroStream BookStore Performance Demo
License: MIT License
MicroStream BookStore Performance Demo
License: MIT License
I'd like to run this against a MariaDB server, but failed.
I started a MariaDB server locally and created the bookstoredemo
schema:
CREATE SCHEMA bookstoredemo;
I changed from the PostgreSQL to the MariaDB JDBC driver in the pom.xml
file:
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
</dependency>
And modified the connection properties in the application.properties
file accordingly:
# commented out these are they are not needed:
#spring.datasource.driverClassName = org.postgresql.Driver
#spring.jpa.database-platform = org.hibernate.dialect.PostgreSQLDialect
# modified these to point to MariaDB:
spring.datasource.url = jdbc:mariadb://localhost:3306/bookstoredemo
spring.datasource.username = user
spring.datasource.password = Password123!
The database connection works. However, when I run the app, I get a BadSqlGrammarException
. Here are the relevant parts from the log:
2023-11-10 21:17:54.847 INFO 89070 --- [ main] o.m.demo.bookstore.Initializer : JPA database is empty, migrating data from MicroStream, strategy = batch_insert
2023-11-10 21:17:54.847 INFO 89070 --- [ main] o.m.d.b.jpa.DataMigrator$BatchInsert : > addresses
2023-11-10 21:17:54.866 INFO 89070 --- [ main] o.m.d.b.jpa.dal.CountryRepositoryImpl : Executing 3 inserts...
2023-11-10 21:17:54.868 WARN 89070 --- [ main] o.m.jdbc.message.server.ErrorPacket : Error: 1064-42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)...' at line 1
2023-11-10 21:17:54.892 WARN 89070 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initializer': Invocation of init method failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[3,'United States','US']};
ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[1,'Canada','CA']};
ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[2,'Germany','DE']};]; nested exception is java.sql.SQLSyntaxErrorException: (conn=337) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)...' at line 1
...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initializer': Invocation of init method failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[3,'United States','US']};
ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[1,'Canada','CA']};
ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[2,'Germany','DE']};]; nested exception is java.sql.SQLSyntaxErrorException: (conn=337) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)...' at line 1
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.8.jar:2.7.8]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.8.jar:2.7.8]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.8.jar:2.7.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.8.jar:2.7.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.8.jar:2.7.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.8.jar:2.7.8]
at one.microstream.demo.bookstore.Application.main(Application.java:20) ~[classes/:na]
Please use Eclipse Store artifacts; the current version is crashing on recent JDK due to https://bugs.openjdk.org/browse/JDK-8325173
I just fork the bookstore-demo and add an api to add boot(call the microstream store), I only add the log but find that it is very slow when adding one boot. you can my project https://github.com/yqbjtu/bookstore-demo/tree/feat/write_perf_log, use the feat/write_perf_log branch, https://github.com/yqbjtu/bookstore-demo/blob/feat/write_perf_log/perf-log/perf-log.md
I used the ssd and my machine has 32G main memory, Java jdk-17.0.4
@fh-ms @hg-ms @fullben
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.