Hi all,
I'm still having a problem with calling a Stored Procedure on a MS
SQL DB. I have some additional information since I turned on SQL
Logging. It just freezes after calling the Stored Procedure. No
errors.
Here's the method:
public void sendToInventoryManagement() {
log.debug("sendToInventoryManagement() called");
NSLog.allowDebugLoggingForGroups(0x10000L);
EOEditingContext ec = this.editingContext();
if (componentPart().partType() == PartType.fetchOneRaw(ec)) {
/*
@BatchID CHAR(21),
@ItemNumber CHAR(31), -- GP Item Number
@QTY NUMERIC(19,5), -- Item Decrease Quantity
@SiteID CHAR(11), -- Location Code/Site for the item. Ex.
WAREHOUSE
@Classification CHAR(15) = '', -- Optional Item
Classification. When these are passed in it looks at
the ott_ItemClassficiation table to see what the offset
account number should be
@outIVDocNum CHAR(17) OUTPUT, -- Inventory Adjustment document
number generated from GP. THis field is outputted to the caller.
@outErrStatus int = 0 output,
@outErrMsg varchar(255) = '' output
*/
String siteId = "WAREHOUSE";
String batchId;
if (usedInManufacturedBatch() != null) {
batchId = EOUtilities.primaryKeyForObject
(ec,usedInManufacturedBatch()).valueForKey("lotCodeId").toString();
} else {
batchId = "BMPartUsage";
}
NSMutableDictionary inputArgs = new
NSMutableDictionary();
inputArgs.takeValueForKey(batchId, "@BatchID");
inputArgs.takeValueForKey(componentPart().partNumber
(),"@ItemNumber");
inputArgs.takeValueForKey(componentQuantity(), "@QTY");
inputArgs.takeValueForKey(siteId, "@SiteID");
inputArgs.takeValueForKey(partUsageType().typeName
(),"@Classification");
inputArgs.takeValueForKey(null,"@outIVDocNum");
inputArgs.takeValueForKey(null,"@outErrStatus");
inputArgs.takeValueForKey(null,"@outErrMsg");
log.debug("About to EXEC
[10.10.10.8].TEST.dbo.ott_spInventoryAdjustment" + "," +
"[EMAIL PROTECTED] = " +
inputArgs.valueForKey("@BatchID") + "," +
"[EMAIL PROTECTED] = " + inputArgs.valueForKey("@ItemNumber") +
"," +
"[EMAIL PROTECTED] = " +
inputArgs.valueForKey("@QTY") + "," +
"[EMAIL PROTECTED] = " +
inputArgs.valueForKey("@SiteID") + "," +
"[EMAIL PROTECTED] = " + inputArgs.valueForKey
("@Classification") + "," +
"[EMAIL PROTECTED] = " + inputArgs.valueForKey("@outIVDocNum") +
"," +
"[EMAIL PROTECTED] = " + inputArgs.valueForKey("@outErrStatus")
+ "," +
"[EMAIL PROTECTED] = " +
inputArgs.valueForKey("@outErrMsg")
);
NSDictionary outputArgs =
EOUtilities.executeStoredProcedureNamed(ec,
"SendToInventoryManagement", inputArgs);
log.debug("Returned From SP Call.");
setPartUsageStatusRelationship
(PartUsageStatus.fetchOneSentToInventoryManagement(ec));
setGpIvDocumentNumber((String) outputArgs.valueForKey
("@outIVDocNum"));
setGpErrorStatus((Integer) outputArgs.valueForKey
("@outErrStatus"));
setGpErrorMessage((String)
outputArgs.valueForKey("@outErrMsg"));
ec.saveChanges();
}
NSLog.refuseDebugLoggingForGroups(0x10000L);
}
Here's the run Log:
[2008-01-30 17:09:20 EST] <main> Waiting for requests...
[2008-01-30 17:10:15,592] <WorkerThread0>
PartUsage.sendToInventoryManagement - sendToInventoryManagement()
called
[2008-01-30 17:10:15 EST] <WorkerThread0> === Begin Internal
Transaction
[2008-01-30 17:10:15 EST] <WorkerThread0> evaluateExpression:
<com.webobjects.jdbcadaptor.MicrosoftPlugIn$MicrosoftExpression:
"SELECT t0.Part_Numbering_Code, t0.Part_Type_ID, t0.Part_Type_Name
FROM dbo.Part_Type t0 WHERE t0.Part_Type_ID = ?" withBindings: 1:2
(partTypeId)>
[2008-01-30 17:10:15 EST] <WorkerThread0> 1 row(s) processed
[2008-01-30 17:10:15 EST] <WorkerThread0> === Commit Internal
Transaction
[2008-01-30 17:10:15,616] <WorkerThread0>
PartUsage.sendToInventoryManagement - About to EXEC
[10.10.10.8].TEST.dbo.ott_spInventoryAdjustment,
@BatchID = 31041,
@ItemNumber = 02070000000011,
@QTY = 286.000000,
@SiteID = WAREHOUSE,
@Classification = Production,
@outIVDocNum = null,
@outErrStatus = null,
@outErrMsg = null
[2008-01-30 17:10:15 EST] <WorkerThread0> executeStoredProcedure:
SendToInventoryManagement withValues:[EMAIL PROTECTED] =
"Production"; @SiteID = "WAREHOUSE"; @ItemNumber =
"02070000000011"; @BatchID = "31041"; @QTY = 286.000000; }
[2008-01-30 17:10:15 EST] <WorkerThread0> === Begin Internal
Transaction
[2008-01-30 17:10:15 EST] <WorkerThread0> evaluateExpression:
<com.webobjects.jdbcadaptor.MicrosoftPlugIn$MicrosoftExpression:
"{ call [10.10.10.8].[TEST].[dbo].[ott_spInventoryAdjustment]
(?, ?, ?, ?, ?, ?, ?, ?)}" withBindings:
1:"Production"(@Classification), 2:"02070000000011"(@ItemNumber),
3:"31041"(@BatchID), 4:286.000000(@QTY),
5:<com.webobjects.foundation.NSKeyValueCoding$Null>(@outIVDocNum),
6:"WAREHOUSE"(@SiteID),
7:<com.webobjects.foundation.NSKeyValueCoding$Null>(@outErrMsg),
8:<com.webobjects.foundation.NSKeyValueCoding$Null>(@outErrSatus)>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%
40global-village.net
This email sent to [EMAIL PROTECTED]