reWriteBatchedInserts not taking effect. #891
Replies: 3 comments
-
This is a driver level parameter so it won't alter what Micronaut Data logs |
Beta Was this translation helpful? Give feedback.
-
Hey Graeme , but I did confirm from the database also , the number of rows it was inserting was still 1 , the batch size not being reflected in the "number of rows affected" |
Beta Was this translation helpful? Give feedback.
-
most likely your configuration is incorrect them and it has been nested under set data source properties https://www.javadoc.io/doc/com.zaxxer/HikariCP/2.7.1/com/zaxxer/hikari/HikariConfig.html#setDataSourceProperties-java.util.Properties- |
Beta Was this translation helpful? Give feedback.
-
Hi , I am trying to do a batch writes into Postgres using Micronaut JDBC.
I can see using debug logs that , Micronaut is executing the batch inserts.
But , following "https://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters" , I tried to provide "reWriteBatchedInserts " as true and hoped that it will write multi rows simultaneously instead of writing one row.
But I don't see the behavior , in the debug log I still see
Executing Batch SQL Insert: INSERT INTO "widetable" ("end","key1","key2","key3","key4","key5","key6","key7","key8","key9","key10","key11","key12","key13","key14","key15","key16","key17","key18","key19","key20","key21","key22","key23","key24","key25","key26","key27","key28","key29","key30","key31","key32","key33","key34","key35","key36","key37","s1","s2","my_composite_key_key_id","my_composite_key_begin","my_composite_key_rec_comp","my_composite_key_book") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) .
Kindly , let me me know , if this is an expected behavior, or if something is missing.
My datasource configuration looks like this
datasources: default: url: jdbc:postgresql://someServer:26257/defaultdb?sslmode=verify-full&sslrootcert=\certPath driverClassName: org.postgresql.Driver username: someuser password: ###### schema-generate: NONE dialect: POSTGRES min-pool-size: 2 maximum-pool-size: 30 batch-generate: true reWriteBatchedInserts: true
Micronaut version : 2.2.2
Micronaut Data : 2.2.1
Java version : 11
OS : Windows
Beta Was this translation helpful? Give feedback.
All reactions