Examples of HibernateTxFragment


Examples of org.jboss.dashboard.database.hibernate.HibernateTxFragment

    }

    public synchronized void schedule(final SchedulerTask task, final Date date, boolean onlyIfCommit) {
        try {
            if (onlyIfCommit) {
                new HibernateTxFragment(false, true) {
                protected void beforeCommit() throws Throwable {
                    _schedule(task, date);
                }}.execute();
            } else {
                _schedule(task, date);
View Full Code Here

Examples of org.jboss.dashboard.database.hibernate.HibernateTxFragment

    }

    public synchronized void schedule(final SchedulerTask task, final long seconds, boolean onlyIfCommit) {
        try {
            if (onlyIfCommit) {
                new HibernateTxFragment(false, true) {
                protected void beforeCommit() throws Throwable {
                    _schedule(task, seconds);
                }}.execute();
            } else {
                _schedule(task, seconds);
View Full Code Here

Examples of org.jboss.dashboard.database.hibernate.HibernateTxFragment

        }
    }

    public synchronized void unschedule(final String key) {
        try {
            new HibernateTxFragment(false, true) {
            protected void beforeCommit() throws Throwable {
                _unschedule(key);
            }}.execute();
        } catch (Exception e) {
            log.error("Unschedule call failed for task: " + key, e);
View Full Code Here

Examples of org.jboss.dashboard.database.hibernate.HibernateTxFragment

        }
    }

    public synchronized void unscheduleAll() {
        try {
            new HibernateTxFragment(false, true) {
            protected void beforeCommit() throws Throwable {
                _unscheduleAll();
            }}.execute();
        } catch (Exception e) {
            log.error("Unschedule all call failed.", e);
View Full Code Here

Examples of org.jboss.dashboard.database.hibernate.HibernateTxFragment

    public boolean doTheInstall() {
        final boolean [] returnvalue = new boolean[]{false};
        if (installTransactional) {
            try {
                new HibernateTxFragment() {
                    protected void txFragment(Session session) throws Exception {
                        returnvalue[0] = install();
                    }
                }.execute();
            } catch (Exception e) {
View Full Code Here

Examples of org.jboss.dashboard.database.hibernate.HibernateTxFragment

    public boolean doTheUpgrade(final long currentVersion) {
        final boolean [] returnvalue = new boolean[]{false};
        if (installTransactional) {
            try {
                new HibernateTxFragment() {
                    protected void txFragment(Session session) throws Exception {
                        returnvalue[0] = upgrade(currentVersion);
                    }
                }.execute();
            } catch (Exception e) {
View Full Code Here

Examples of org.jboss.dashboard.database.hibernate.HibernateTxFragment

     * Get all registered datasource entries
     */
    public List<DataSourceEntry> getDataSourceEntries() {
        final List result = new ArrayList();
        try {
            new HibernateTxFragment() {
            protected void txFragment(Session session) throws Exception {
                Query query = session.createQuery(" from " + DataSourceEntry.class.getName());
                FlushMode oldFlushMode = session.getFlushMode();
                session.setFlushMode(FlushMode.COMMIT);
                query.setCacheable(true);
View Full Code Here

Examples of org.jboss.dashboard.database.hibernate.HibernateTxFragment

    public DataSourceEntry getDataSourceEntry(final String name) throws Exception {
        if (name == null) return null;

        final List results = new ArrayList();
        new HibernateTxFragment() {
        protected void txFragment(Session session) throws Exception {
            FlushMode flushMode = session.getFlushMode();
            session.setFlushMode(FlushMode.COMMIT);

            StringBuffer sql = new StringBuffer();
View Full Code Here

Examples of org.jboss.dashboard.database.hibernate.HibernateTxFragment

    }

    protected boolean setParameters(final CommandRequest request, final PanelProviderParameter[] params, final PanelInstance instance, final boolean specificParameters) throws Exception {
        final boolean anyParamWritten[] = new boolean[]{false};

        new HibernateTxFragment(){
            @Override
            protected void txFragment(Session session) throws Throwable {
                super.txFragment(session);
                String language = LocaleManager.lookup().getCurrentLang();
View Full Code Here

Examples of org.jboss.dashboard.database.hibernate.HibernateTxFragment

    /**
     * Removes panel from its region, but keeping it assigned to this section.
     */
    public CommandResponse panelActionClose(final Panel panel, CommandRequest request) {

        HibernateTxFragment txFragment = new HibernateTxFragment() {
            protected void txFragment(Session session) throws Exception {
                log.debug("Closing panel " + panel.getPanelId());
                beforePanelClosed(panel);
                Section section = panel.getSection();
                section.removePanelFromRegion(panel);
                UIServices.lookup().getSectionsManager().store(section);
                fireAfterPanelClosed(panel);
            }
        };

        try {
            txFragment.execute();
        } catch (Exception e) {
            log.error("Can't remove panel from region.", e);
        }
        return new ShowPanelPage();
    }
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.