Hello, I just checked the latest source code of DataNucleus HBase plugin, and it seems this is a bug of the plugin introduced at revision 7915.
Diff: http://datanucleus.svn.sourceforge.net/viewvc/datanucleus/platform/store.hbase/trunk/src/java/org/datanucleus/store/hbase/HBasePersistenceHandler.java?r1=7898&r2=7915 Source code (r7915): http://datanucleus.svn.sourceforge.net/viewvc/datanucleus/platform/store.hbase/trunk/src/java/org/datanucleus/store/hbase/HBasePersistenceHandler.java?revision=7915&view=markup As you can see at the line 248 -- 251 of updateObject(), the plugin does Delete() after Put(). I'd suggest you to file a JIRA issue at: http://www.jpox.org/servlet/jira/browse/NUCHBASE Thanks, -- 河野 達也 Tatsuya Kawano (Mr.) Tokyo, Japan On Thu, Jan 28, 2010 at 7:36 AM, dShaman <[email protected]> wrote: > > I was able to get a Java based client up using Hbase which seems to work just > fine, but when I stuck a JDO layer on top via DataNucleus, I got some weird > behavior during update. It seemed liked I could insert records, delete > records, and read records, but when I try to do an update, the record gets > removed! > > Has anyone else had an issue like this? My testing code was pretty > primitive so I'm wondering if it might be a configuration issue with > hbase/zookeeper or something else: > > public void test() { > File propsFile = new > File(AbstractPersistenceTest.DATA_NUCLEUS_PROPERTIES); > PersistenceManagerFactory pmf = > JDOHelper.getPersistenceManagerFactory(propsFile); > PersistenceManager pm = pmf.getPersistenceManager(); > > Transaction tx = pm.currentTransaction(); > Fake entity = null; > try { > tx.begin(); > entity = createEntity(); > pm.makePersistent(entity); > tx.commit(); > } finally { > if (tx.isActive()) { > tx.rollback(); > } > } > > String oldUUID = entity.getId(); > String updatedName = "New Name"; > tx = pm.currentTransaction(); > try { > tx.begin(); > Fake readEntity = null; > readEntity = (Fake)pm.getObjectById(entity.getClass(), entity.getId()); > readEntity.setName(updatedName); > tx.commit(); > } finally { > if (tx.isActive()) { > tx.rollback(); > } > } > > Fake updatedEntity = (Fake)pm.getObjectById(entity.getClass(), oldUUID); > // fails here. can't find record > assertEquals(updatedName, updatedEntity.getName()); > }
