Examples of RDBMSAdapter


Examples of org.jpox.store.rdbms.adapter.RDBMSAdapter

                {
                    MappedStoreManager storeMgr = (MappedStoreManager)omfContext.getStoreManager();
                    if (storeMgr != null && storeMgr.getDatastoreAdapter() != null)
                    {
                        // Create Connection following DatastoreAdapter capabilities
                        RDBMSAdapter rdba = (RDBMSAdapter)storeMgr.getDatastoreAdapter();
                        int reqdIsolationLevel = isolation;
                        if (rdba.getRequiredTransactionIsolationLevel() >= 0)
                        {
                            // Override with the adapters required isolation level
                            reqdIsolationLevel = rdba.getRequiredTransactionIsolationLevel();
                        }

                        DataSource[] ds = (DataSource[])dataSource;
                        cnx = new ConnectionProviderPriorityList().getConnection(ds);
                        boolean succeeded = false;
                        try
                        {
                            if (reqdIsolationLevel == UserTransaction.TRANSACTION_NONE)
                            {
                                if (!cnx.getAutoCommit())
                                {
                                    cnx.setAutoCommit(true);
                                }
                            }
                            else
                            {
                                if (cnx.getAutoCommit())
                                {
                                    cnx.setAutoCommit(false);
                                }
                                if (rdba.supportsTransactionIsolationLevel(reqdIsolationLevel))
                                {
                                    int currentIsolationLevel = cnx.getTransactionIsolation();
                                    if (currentIsolationLevel != reqdIsolationLevel)
                                    {
                                        cnx.setTransactionIsolation(reqdIsolationLevel);
View Full Code Here

Examples of org.jpox.store.rdbms.adapter.RDBMSAdapter

        RDBMSManager srm = (RDBMSManager)storeMgr;
        SQLController sqlControl = srm.getSQLController();
        try
        {
            // Find the next ID from the database
            RDBMSAdapter dba = (RDBMSAdapter) srm.getDatastoreAdapter();

            String stmt = dba.getSelectNewUUIDStmt();

            ps = sqlControl.getStatementForQuery(connection, stmt);
            for (int i=1; i<size; i++)
            {
                rs = sqlControl.executeStatementQuery(connection, stmt, ps);
View Full Code Here

Examples of org.jpox.store.rdbms.adapter.RDBMSAdapter

        RDBMSManager srm = (RDBMSManager)storeMgr;
        SQLController sqlControl = srm.getSQLController();
        try
        {
            // Get next available id
            RDBMSAdapter dba = (RDBMSAdapter) srm.getDatastoreAdapter();

            String stmt = dba.getSequenceNextStmt(getSequenceName());
            ps = sqlControl.getStatementForQuery(connection, stmt);
            rs = sqlControl.executeStatementQuery(connection, stmt, ps);
            Long nextId = new Long(0);
            if (rs.next())
View Full Code Here

Examples of org.jpox.store.rdbms.adapter.RDBMSAdapter

     */
    protected boolean createRepository()
    {
        PreparedStatement ps = null;
        RDBMSManager srm = (RDBMSManager)storeMgr;
        RDBMSAdapter dba = (RDBMSAdapter)srm.getDatastoreAdapter();
        SQLController sqlControl = srm.getSQLController();

        String stmt = dba.getSequenceCreateStmt(getSequenceName(),
                    (String) properties.get("key-min-value"),
                    (String) properties.get("key-max-value"),
                    (String) properties.get("key-start-with"),
                    (String) properties.get("key-increment-by"),
                    (String) properties.get("key-database-cache-size"));
View Full Code Here

Examples of org.jpox.store.rdbms.adapter.RDBMSAdapter

            // No range specified so dont apply checks!
            return false;
        }

        RDBMSManager storeMgr = (RDBMSManager)om.getStoreManager();
        RDBMSAdapter dba = (RDBMSAdapter)storeMgr.getDatastoreAdapter();
        boolean using_limit_select_clause = (dba.getRangeByLimitSelectClause(fromInclNo, toExclNo).length() > 0);
        boolean using_limit_where_clause = (dba.getRangeByLimitWhereClause(fromInclNo, toExclNo).length() > 0);
        boolean using_rownum = (dba.getRangeByRowNumberColumn().length() > 0);
        boolean applyRangeChecks =
            (range_specified && !using_limit_select_clause && !using_limit_where_clause && !using_rownum);

        return applyRangeChecks;
    }
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.