The following code snippet shows how to make an object persistent in JDO.

Java Code:
Employee emp = new Employee("Dave Muller", 23, 37000.00);
Transaction tx;
try {
  tx = pm.currentTransaction();
  tx.begin();
  pm.makePersistent(emp);
  tx.commit();
} catch (Exception e) {
  if(tx.isActive()) {
    tx.rollback();
  }
}