Ejemplo n.º 1
0
RCODE CSPDB::registerFieldArray(HFDB hFlaim, CS_FIELD_DEF *fieldTable, FLMINT count)
{
	RCODE				rc = FERR_OK;
	int 				i;

	// Begin a flaim transaction.
	rc = FlmDbTransBegin(hFlaim, FLM_UPDATE_TRANS, 255);
	if (RC_OK(rc))
	{
		for (i = 0; i < count; ++i)
		{
			FLMUINT		fieldId = fieldTable[i].id;
			rc = RegisterField(hFlaim, fieldTable[i].name, CSPTypeToFlaimType(fieldTable[i].type), &fieldId);
			if (RC_BAD(rc))
			{
				break;
			}
		}
		if (RC_OK(rc))
		{
	 		FlmDbTransCommit(hFlaim);
		}
		else
		{
			FlmDbTransAbort(hFlaim);
		}
	}
	return (rc);
} // CSPDB::registerFieldArray()
Ejemplo n.º 2
0
RCODE CSPDB::registerIndexArray(HFDB hFlaim, CS_FIELD_DEF *indexTable, FLMINT count)
{
	RCODE				rc = FERR_OK;
	int					i;

	rc = FlmDbTransBegin(hFlaim, FLM_UPDATE_TRANS, 255);
	if (RC_OK(rc))
	{
		for (i = 0; i < count; ++i)
		{
			rc = AddIndex(hFlaim, indexTable[i].name, indexTable[i].id);
			if (RC_BAD(rc))
			{
				break;
			}
		}
		if (RC_OK(rc))
		{
	 		rc = FlmDbTransCommit(hFlaim);
		}
		else
		{
			rc = FlmDbTransAbort(hFlaim);
		}
	}

	return (rc);
} // CSPDB::registerIndexArray()
Ejemplo n.º 3
0
/********************************************************************
Desc: Commits the current transaction - fixes up the parent object to
		point to the last child added before committing.
*********************************************************************/
RCODE gigaCommitTrans( void)
{
	RCODE				rc = NE_FLM_OK;

	gigaOutputUINT( TOTAL_LOADED_ROW, gv_uiTotalLoaded);

	// Commit the transaction.

	if( RC_BAD( rc =  FlmDbTransCommit( gv_hDb)))
	{
		gigaOutputRcErr( "committing transaction", rc);
		goto Exit;
	}

Exit:

	return( rc);
}
Ejemplo n.º 4
0
RCODE CSPStore::EndTrans()
{
	RCODE rc = FERR_OK;
	//if (m_InTrans)
	//{
		rc = FlmDbTransCommit(m_hFlaim);
		if (RC_BAD(rc))
		{
			FlmDbTransAbort(m_hFlaim);
		}

	//	m_InTrans = false;
	//}
	//else
	//{
	//	rc = FERR_NO_TRANS_ACTIVE;
	//}
	return (rc);
} // CSPStore::EndTrans()