Re: fromBlob is not called on ERXMutableDictionary with mutableDictionary prototype
Re: fromBlob is not called on ERXMutableDictionary with mutableDictionary prototype
- Subject: Re: fromBlob is not called on ERXMutableDictionary with mutableDictionary prototype
- From: Denis Frolov <email@hidden>
- Date: Fri, 12 Jan 2007 17:47:05 +0300
- Thread-topic: fromBlob is not called on ERXMutableDictionary with mutableDictionary prototype
Sorry for answering to myself, but it looks like the solution with try/catch
and forced conversion has it's problems:
@Test
public void deleteObjectWithMutableDictionary() {
EOEditingContext ec = new EOEditingContext();
RootObject rootObject = (RootObject)
RootObject.clazz.createAndInsertObject(ec);
rootObject.setUploadsFileNames(new ERXMutableDictionary(new
NSDictionary("value", "key")));
ec.saveChanges();
ec.invalidateAllObjects();
ec.deleteObject((EOEnterpriseObject)
EOUtilities.objectsForEntityNamed(ec, RootObject.ENTITY_NAME).lastObject());
ec.saveChanges();
}
This test fails with exception:
com.webobjects.eoaccess.EOGeneralAdaptorException: Class
com.webobjects.foundation.NSData does not implement method toBlob
at
com.webobjects.eoaccess.EODatabaseContext._exceptionWithDatabaseContextInfor
mationAdded(EODatabaseContext.java:4685)
at
com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseContext.j
ava:6393)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContex
t(EOObjectStoreCoordinator.java:415)
at
com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:
3226)
at
dm.extensions.tests.PrototypesTest.deleteObjectWithMutableDictionary(Prototy
pesTest.java:56)
Will stick to using the externalType = TEXT for attribute for now, although
this hack looks even worse since type in eomodel is different from the one
in database.
on 1/12/07 1:37 PM, Denis Frolov at email@hidden wrote:
> Hi,
>
> I have the same problem as Timo had in this thread two years ago:
> http://www.wodeveloper.com/omniLists/webobjects-dev/2004/March/msg00340.html
>
> I'm also using try/catch to do a manual conversion in eo's accessor method.
> I've also noticed that the problem goes away if I change attribute's
> externalType to TEXT in eomdel while leaving it set to BLOB in database.
> Although this solution seems to be viable - it is of no real use since
> database's field will be set to TEXT next time sql is generated from
> EOModeler/Entity Modeler.
>
> I've also tried
>
> I'm using mysql-connector-java-3.1.14-bin.jar and MySQL 4.1.18.
>
> The questions are:
> 1. Did anyone (Timo?) succeed in solving the problem?
> 2. Is there any hidden danger in calling "fromBlob" to make a conversion so
> late in eo's accessor method manually? Can this lead to EOF problems?
>
> ---
> Denis Frolov
> Design Maximum MA
>
> Tel: +7 863 2648211
> Fax: +7 863 2645229
> Web: http://www.designmaximum.com
>
---
Denis Frolov
Design Maximum MA
Tel: +7 863 2648211
Fax: +7 863 2645229
Web: http://www.designmaximum.com
_______________________________________________
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