title: how do i make hazelcast to store in my database using MapStore implementation
body: <p>I implemented <code>MapStore</code> and configured hazelcast (v 2.2) so that it would know that when calling <code>map.put()</code> it has to call in background <code>.store</code> from my implementation, at least that`s what i read.</p>
  
  <p>If i use my implementation directly it does store what I want but if I call <code>map.put()</code> it doesn't.
  Can someone tell me why it doesn't or if i`m doing something wrong?</p>
  
  <p>here is my <code>MapStore</code> implementation:</p>
  
  <pre><code>public class MyMapStore implements MapStore&lt;String, Object&gt; {
  
  private Session session = HibernateUtil.openSession();
  
  @Override
  public Object load(String key) {
              // TODO Auto-generated method stub
              return null;
  }
  
  @Override
  public Map&lt;String, Object&gt; loadAll(Collection&lt;String&gt; keys) {
      // TODO Auto-generated method stub
      return null;
  }
  
  @Override
  public Set&lt;String&gt; loadAllKeys() {
      // TODO Auto-generated method stub
      return null;
  }
  
  @Override
  public void store(String key, Object value) {
      Transaction tx = session.beginTransaction();
      session.save((MyObject)value);
      tx.commit();
  }
  
  @Override
  public void storeAll(Map&lt;String, Object&gt; map) {
      // TODO Auto-generated method stub
  }
  
  @Override
  public void delete(String key) {
              // TODO Auto-generated method stub
  }
  
  @Override
  public void deleteAll(Collection&lt;String&gt; keys) {
      // TODO Auto-generated method stub
  }
  }
  </code></pre>
  
  <p>Hazelcast configuration:</p>
  
  <pre><code>h.getConfig().getMapConfig("default").setMapStoreConfig(
      new MapStoreConfig().setEnabled(true).setClassName(
      MyMapStore.class.getName()).setWriteDelaySeconds(0));
  </code></pre>
  
  <p>Printing the hazelcast configuration tells that all I set is there so I don't know what`s wrong.</p>