Re: Optimistick locking problem
Re: Optimistick locking problem
- Subject: Re: Optimistick locking problem
- From: Chuck Hill <email@hidden>
- Date: Tue, 13 Sep 2005 12:18:13 -0700
How did the data get into the database? Does 2:"1N-748-T"(articulo)
have any spaces before or after when you look directly at the
database. Things like "1N-748-T " (notice the space after T) can
cause this.
Chuck
On Sep 13, 2005, at 10:17 AM, Marcos Trejo Munguia wrote:
Hi list:
I'm using WebObjects 5.2.3 on Mac OS X 10.3.9 and the database
MSSQL Server 2000 on a Windows NT Machine.
I get the next exception when I try to update a row:
Error: com.webobjects.eoaccess.EOGeneralAdaptorException:
updateValuesInRowDescribedByQualifier --
com.webobjects.jdbcadaptor.JDBCChannel method failed to update row
in database
Reason: updateValuesInRowDescribedByQualifier --
com.webobjects.jdbcadaptor.JDBCChannel method failed to update row
in database
Stack trace:
File Line# Method Package
EODatabaseContext.java 4676
_exceptionWithDatabaseContextInformationAdded
com.webobjects.eoaccess
EODatabaseContext.java 6384 performChanges
com.webobjects.eoaccess
EOObjectStoreCoordinator.java 415
saveChangesInEditingContext com.webobjects.eocontrol
EOEditingContext.java 3165 saveChanges
com.webobjects.eocontrol
Main.java 24 <init> Main
NativeConstructorAccessorImpl.java NA newInstance0
sun.reflect
NativeConstructorAccessorImpl.java 39 newInstance
sun.reflect
DelegatingConstructorAccessorImpl.java 27 newInstance
sun.reflect
Constructor.java 274 newInstance java.lang.reflect
_NSUtilities.java 575 instantiateObject
com.webobjects.foundation
WOComponentDefinition.java 463
_componentInstanceInContext com.webobjects.appserver._private
WOComponentDefinition.java 573
componentInstanceInContext com.webobjects.appserver._private
WOApplication.java 1954 pageWithName
com.webobjects.appserver
WOComponentRequestHandler.java 273
_dispatchWithPreparedSession com.webobjects.appserver._private
WOComponentRequestHandler.java 322
_dispatchWithPreparedApplication com.webobjects.appserver._private
WOComponentRequestHandler.java 358 _handleRequest
com.webobjects.appserver._private
WOComponentRequestHandler.java 432 handleRequest
com.webobjects.appserver._private
WOApplication.java 1306 dispatchRequest
com.webobjects.appserver
WOWorkerThread.java 173 runOnce
com.webobjects.appserver._private
WOWorkerThread.java 254 run
com.webobjects.appserver._private
Thread.java 552 run java.lang
The code that throws the exception:
EOEditingContext ec = new EOEditingContext();
EOFetchSpecification fs = new EOFetchSpecification
("Articulo", null, null, true, false, null);
fs.setRefreshesRefetchedObjects(true);
fs.setFetchLimit(1);
Articulo articulo = (Articulo)
ec.objectsWithFetchSpecification(fs).lastObject();
articulo.setTipo("Luminaria");
ec.saveChanges();
and the SQL generated:
"UPDATE dbo.Art SET Tipo = ? WHERE Articulo = ?" withBindings:
1:"Luminaria"(tipo), 2:"1N-748-T"(articulo)
My model looks like this:
{
attributes = (
{
columnName = Accesorios;
externalType = bit;
name = accesorios;
precision = 1;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = Articulo;
externalType = char;
name = articulo;
valueClassName = NSString;
valueType = c;
width = 20;
},
{
columnName = Conciliar;
externalType = bit;
name = conciliar;
precision = 1;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = Estatus;
externalType = char;
name = estatus;
valueClassName = NSString;
valueType = c;
width = 15;
},
{
columnName = Impuesto1;
externalType = float;
name = impuesto1;
precision = 53;
valueClassName = NSNumber;
valueType = f;
},
{
columnName = MonedaCosto;
externalType = char;
name = monedacosto;
valueClassName = NSString;
valueType = c;
width = 10;
},
{
columnName = MonedaPrecio;
externalType = char;
name = monedaprecio;
valueClassName = NSString;
valueType = c;
width = 10;
},
{
columnName = ProdOpciones;
externalType = bit;
name = prodopciones;
precision = 1;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = Refacciones;
externalType = bit;
name = refacciones;
precision = 1;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = Refrigeracion;
externalType = bit;
name = refrigeracion;
precision = 1;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = SeProduce;
externalType = bit;
name = seproduce;
precision = 1;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = Sustitutos;
externalType = bit;
name = sustitutos;
precision = 1;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = TieneCaducidad;
externalType = bit;
name = tienecaducidad;
precision = 1;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = Tipo;
externalType = varchar;
name = tipo;
valueClassName = NSString;
valueType = S;
width = 20;
},
{
columnName = TipoOpcion;
externalType = varchar;
name = tipoopcion;
valueClassName = NSString;
valueType = S;
width = 20;
}
);
attributesUsedForLocking = (articulo);
className = Articulo;
classProperties = (
impuesto1,
tipo,
tipoopcion,
accesorios,
refacciones,
sustitutos,
monedacosto,
monedaprecio,
estatus,
conciliar,
refrigeracion,
tienecaducidad,
seproduce,
prodopciones
);
externalName = "dbo.Art";
fetchSpecificationDictionary = {};
name = Articulo;
primaryKeyAttributes = (articulo);
}
As you can see I'm locking on a String with value type c, I'm not
sure what the problem is and how to fix it, please somebody help
me, I'll appreciate your help.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden