| | |
| | | import java.sql.Statement; |
| | | import java.sql.Types; |
| | | import java.util.Date; |
| | | import java.io.IOException; |
| | | |
| | | import org.apache.commons.collections.OrderedMap; |
| | | import org.apache.commons.collections.OrderedMapIterator; |
| | |
| | | , null); |
| | | |
| | | logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode); |
| | | jobContext.startTransaction(); |
| | | int total = map.size(); |
| | | |
| | | int total = map.size(); //spacenodes count |
| | | int step = total / 100; |
| | | int current = 0; |
| | | |
| | | //jobContext.startTransaction(); |
| | | jobContext.getExecutionContext().put("ConvertDgn2ShpJobProgress", 0); |
| | | for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) |
| | | { |
| | |
| | | // OracleConnection connection = jobContext.getOracleConnection(); |
| | | // connection.commitTransaction(); |
| | | jobContext.commitTransaction(); |
| | | //jobContext.startTransaction(); |
| | | System.gc(); |
| | | } |
| | | |
| | |
| | | { |
| | | current = now; |
| | | jobContext.getExecutionContext().put("ConvertDgn2ShpJobProgress", current); |
| | | |
| | | } |
| | | } |
| | | jobContext.getExecutionContext().put("ConvertDgn2ShpJobProgress", 100); |
| | | |
| | | jobContext.commitTransaction(); |
| | | try { |
| | | jobContext.closeFeatureWrite(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. |
| | | } |
| | | logger.info("end convert job:[" + order + "]"); |
| | | System.gc(); |
| | | } |
| | |
| | | String fetchSrcStmt = spf.sprintf(new Object[]{srcschema, srctable}); |
| | | Statement stmtSrc = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); |
| | | |
| | | stmtSrc.setFetchSize(FETCHSIZE); |
| | | stmtSrc.setFetchSize(FETCHSIZE); |
| | | |
| | | ResultSet rsSrc = stmtSrc.executeQuery(fetchSrcStmt); |
| | | |
| | |
| | | logger.warn("Dgn7Exception", e); |
| | | } |
| | | } |
| | | |
| | | rsSrc.close(); |
| | | stmtSrc.close(); |
| | | } |
| | | |
| | | protected void queryRawElement(OracleConvertJobContext jobContext, |
| | |
| | | logger.warn("Dgn7Exception:" + e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | rsDest.close(); |
| | | stmtDest.close(); |
| | | } |
| | | |
| | | private Element fetchBinaryElement(byte[] raws) throws Dgn7fileException |