A very small number of my NHibernate queries are bulk-data related.
And I want to use Query Hints which unfortunately are not supported by
NHibernate or Hibernate*. So I have added the hints in OnBeforePrepare
in a custom Driver. Is this a sensible thing to do, or will I forever
regret this decision?
Note: I'm also using the Batching capabilities of NHibernate. I can't
overstate how great this is. I probably replaced 200 lines of code
which did Oracle Array Binding via ODP.Net with a single NHibernate
configuration change.
public class MyOracleDataClientDriver : OracleDataClientDriver
{
protected override void OnBeforePrepare(IDbCommand command)
{
base.OnBeforePrepare(command);
command.CommandText = command.CommandText.Replace("INSERT
INTO tblRegions", "INSERT /*+ APPEND */ INTO tblRegions");
}
}
[this code is not the real code, it's for demonstration only]
Richard
* Hibernate have been thinking about query hints:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2736
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.