assertActiveTransaction();
if (_savepoints != null && _savepoints.containsKey(name))
throw new UserException(_loc.get("savepoint-exists", name));
if (hasFlushed() && !_spm.supportsIncrementalFlush())
throw new UnsupportedException(_loc.get
("savepoint-flush-not-supported"));
OpenJPASavepoint save = _spm.newSavepoint(name, this);
if (_savepoints == null || _savepoints.isEmpty()) {
save.save(getTransactionalStates());