Note that there are some explanatory texts on larger screens.

plurals
  1. POSerializing NHibernate Configuration using protocol buffers (M.Gravells impl - protobuf-net)?
    primarykey
    data
    text
    <p>Is it even possible and feasible without the attribute mappings ? I'm currently using BinaryFormatter with ZLib compression which gave a nice boost for deserialization (3x), but still a tad slow.</p> <p>Edit2: Setting up the configuration</p> <pre><code> public static NHibernate.Cfg.Configuration BuildConfiguration() { FirebirdSql.Data.FirebirdClient.FbConnection.CreateDatabase(CONNECTION_STRING); var cfg = new FirebirdConfiguration().ConnectionString(CONNECTION_STRING); var configuration = Fluently.Configure() .Database(cfg) .Mappings(m =&gt; m.FluentMappings.AddFromNamespaceOf&lt;DataMap&gt;()) .ExposeConfiguration(BuildSchema) .ExposeConfiguration(config =&gt; { config.Properties.Add("use_proxy_validator", "false"); // bugfix nhib 3.2, see issues-2011-12-01.txt config.AppendListeners(ListenerType.PreUpdate, new IPreUpdateEventListener[] { new PreUpdateEventImpl() }); config.AppendListeners(ListenerType.PreInsert, new IPreInsertEventListener[] { new PreInsertEventImpl() }); }) .BuildConfiguration(); return configuration; } private static void BuildSchema(Configuration cfg) { new SchemaExport(cfg).Create(false, true); } </code></pre> <p>Edit: Here's the code with everything -not-related- removed.</p> <p>I doubt it's going to help much, as i have no idea on how to get started combining nhibernate config with protobuf-net (Hand modifying the NHibernate source is out of the question).</p> <pre><code> public static NHibernate.Cfg.Configuration DeserializeConfiguration() { Configuration configuration = null; using (var file = File.Open(CONFIG_PATH, FileMode.Open)) { configuration = new BinaryFormatter().Deserialize(file) as Configuration; } return configuration; } public static NHibernate.Cfg.Configuration SerializeConfiguration(Configuration configuration) { using (var file = File.Open(CONFIG_PATH, FileMode.Create)) { new BinaryFormatter().Serialize(fs, configuration); } return configuration; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload