27354

How to configure custom MySQL NHibernate Batcher?

Question:

NHibernate with MySQL Dialect does not support Batching out of the box. I have found custom MySQL Batcher for NHibernate on nuget. Also, following is the github link:

<a href="https://github.com/Andorbal/NHibernate.MySQLBatcher" rel="nofollow">https://github.com/Andorbal/NHibernate.MySQLBatcher</a>

But I do not know how to inject/set this into my hibernate.cfg.xml configuration.

How to configure custom MySQL NHibernate Batcher?

Answer1:

The property you need to set is call "adonet.factory_class". Use any of the following:

<property name="adonet.factory_class">assembly-qualified-name</property>

or

configuration.SetProperty( Environment.BatchStrategy, typeof(MySqlClientBatchingBatcherFactory).AssemblyQualifiedName);

or as noted in the readme of the batcher itself (https://github.com/Andorbal/NHibernate.MySQLBatcher):

config.DataBaseIntegration(db => db.Batcher<MySqlClientBatchingBatcherFactory>());

Recommend

  • Change GWT project to Maven Project
  • how to search an Id using hibernate query by example?
  • How to write Hibernate HQL query which remove all “grand children” elements?
  • Java EE 5 and Hibernate
  • hibernate cascade - update child to null
  • Joining tables without relation using JPA criteria
  • NHibernate - Could not execute query - Input string was not in a correct format
  • HQL: variable column
  • How should I organize my c# solution?
  • Remove HTTP Response headers in Java
  • After switching from Spring Boot 1.2.8 to 1.3.2 application magically stops working
  • Hibernate reverse engineering - mapping a table to Java enum
  • Why do Unicode characters show up properly in database, but as ? when printed in Java via Hibernate?
  • Hibernate query filter on collection
  • Hibernate generation index and foreign key with same name for MySQL
  • Spring bean validation messages resolution
  • Migrating from java 1.4 ,EJB 1 to Java 6 and EJB 3 [closed]
  • NHibernate proxyexception
  • Sybase Error Implicit Conversion from datatype 'VARCHAR' to 'INT' not allowed
  • iOS Cordova first plugin - plugin.xml to inject a feature
  • How do I configure context broker accept post requests from my remote sensor?
  • Play WS (2.2.1): post/put large request
  • How can I send an e-mail from a vbs script
  • PHP - How to update data to MySQL when click a radio button
  • RectangularRangeIndicator format like triangular using dojo
  • swift auto completion not working in Xcode6-Beta
  • angularjs unit test when to use $rootScope.$new()
  • Cross-Platform Protobuf Serialization
  • Deserializing XML into class C#
  • Is there a mandatory requirement to switch app.yaml?
  • Revoking OAuth Access Token Results in 404 Not Found
  • How to set the response of a form post action to a iframe source?
  • Angular 2 constructor injection vs direct access
  • Change div Background jquery
  • Qt: Run a script BEFORE make
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • How to get NHibernate ISession to cache entity not retrieved by primary key
  • reshape alternating columns in less time and using less memory
  • How to Embed XSL into XML
  • UserPrincipal.Current returns apppool on IIS