Shared static instance of DefaultDataBufferFactory

This commit is contained in:
Rossen Stoyanchev
2020-06-24 16:12:34 +01:00
parent 3a06622270
commit b16f6fa456
67 changed files with 184 additions and 273 deletions

View File

@@ -74,7 +74,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
private boolean ignoreFailedDrops = false;
private DataBufferFactory dataBufferFactory = new DefaultDataBufferFactory();
private DataBufferFactory dataBufferFactory = DefaultDataBufferFactory.sharedInstance;
/**

View File

@@ -512,8 +512,9 @@ public abstract class ScriptUtils {
* @see org.springframework.r2dbc.connection.ConnectionFactoryUtils#releaseConnection
*/
public static Mono<Void> executeSqlScript(Connection connection, EncodedResource resource) throws ScriptException {
return executeSqlScript(connection, resource, new DefaultDataBufferFactory(), false, false, DEFAULT_COMMENT_PREFIX,
DEFAULT_STATEMENT_SEPARATOR, DEFAULT_BLOCK_COMMENT_START_DELIMITER, DEFAULT_BLOCK_COMMENT_END_DELIMITER);
return executeSqlScript(connection, resource, DefaultDataBufferFactory.sharedInstance, false, false,
DEFAULT_COMMENT_PREFIX, DEFAULT_STATEMENT_SEPARATOR, DEFAULT_BLOCK_COMMENT_START_DELIMITER,
DEFAULT_BLOCK_COMMENT_END_DELIMITER);
}
/**

View File

@@ -213,7 +213,7 @@ public class ScriptUtilsUnitTests {
private String readScript(String path) {
EncodedResource resource = new EncodedResource(
new ClassPathResource(path, getClass()));
return ScriptUtils.readScript(resource, new DefaultDataBufferFactory()).block();
return ScriptUtils.readScript(resource, DefaultDataBufferFactory.sharedInstance).block();
}
}