Package com.cloud.utils.db

Examples of com.cloud.utils.db.TransactionLegacy.commit()


        NetworkACLItemVO dbNetworkACLItem = super.persist(networkAclItem);
        saveCidrs(networkAclItem, networkAclItem.getSourceCidrList());
        loadCidrs(dbNetworkACLItem);

        txn.commit();
        return dbNetworkACLItem;
    }

    public void saveCidrs(NetworkACLItemVO networkACLItem, List<String> cidrList) {
        if (cidrList == null) {
View Full Code Here


            txn.start();
            for (EventVO event : events) {
                event = lockRow(event.getId(), true);
                event.setArchived(true);
                update(event.getId(), event);
                txn.commit();
            }
            txn.close();
        }
    }
}
View Full Code Here

        for (Map.Entry<String, String> detail : details.entrySet()) {
            UsageEventDetailsVO vo = new UsageEventDetailsVO(eventId, detail.getKey(), detail.getValue());
            persist(vo);
        }
        txn.commit();
    }

}
View Full Code Here

                stmtInsert.setString(3, value);
                if (stmtInsert.executeUpdate() < 1) {
                    throw new CloudRuntimeException("Unable to init template " + id + " datails: " + name);
                }
            }
            txn.commit();
        } catch (Exception e) {
            s_logger.warn("Unable to init template " + id + " datails: " + name, e);
            throw new CloudRuntimeException("Unable to init template " + id + " datails: " + name);
        }
    }
View Full Code Here

        boolean persisted = super.update(zoneId, zone);
        if (!persisted) {
            return persisted;
        }
        saveDetails(zone);
        txn.commit();
        return persisted;
    }

    @Override
    public void loadDetails(DataCenterVO zone) {
View Full Code Here

        zone.setName(null);

        update(id, zone);

        boolean result = super.remove(id);
        txn.commit();
        return result;
    }

    @Override
    public List<DataCenterVO> listAllZones() {
View Full Code Here

                stmt.setLong(2, dcId);
                stmt.setLong(3, physicalNetworkId);
                stmt.addBatch();
            }
            stmt.executeBatch();
            txn.commit();
        } catch (SQLException e) {
            throw new CloudRuntimeException(e.getMessage());
        }
    }
View Full Code Here

        vo.setTakenAt(now);
        vo.setAccountId(accountId);
        vo.setReservationId(reservationId);
        update(vo.getId(), vo);
        txn.commit();
        return vo;
    }

    @Override
    public void release(String vnet, long physicalNetworkId, long accountId, String reservationId) {
View Full Code Here

        pod.setName(null);

        update(id, pod);

        boolean result = super.remove(id);
        txn.commit();
        return result;
    }

    @Override
    public List<Long> listDisabledPods(long zoneId) {
View Full Code Here

            final Filter filter = new Filter(HaWorkVO.class, null, true, 0l, 1l);

            txn.start();
            final List<HaWorkVO> vos = lockRows(sc, filter, true);
            if (vos.size() == 0) {
                txn.commit();
                return null;
            }

            final HaWorkVO work = vos.get(0);
            work.setServerId(serverId);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.