Hi,

following test against 1.7.8-SNAPSHOT:

List<String> propertiesList = new ArrayList<String>();
propertiesList.add("name");
propertiesList.add("test1");
propertiesList.add("inherited");
propertiesList.add("true");

LOGGER.info("insert data...");
OrientVertex vertex = graph.addVertex("class:Characteristic" , 
propertiesList.toArray(new Object[propertiesList.size()]));
graph.commit();
LOGGER.info("insert data...done");
        
LOGGER.info("change property name..."); /
graphNoTx.getVertexType("Characteristic").getProperty("inherited").setName("valueInherited");
LOGGER.info("change property name...done");

graph.getRawGraph().getLevel1Cache().clear();
graph.getRawGraph().getLevel2Cache().clear();
        
OrientVertex vertexFromDb = graph.getVertex(vertex.getId()); // reload the 
vertex
System.out.println(graph.getVertexType("Characteristic").getProperty("valueInherited").getName());
 
// returns valueInherited  ... expected
System.out.println(graph.getVertexType("Characteristic").getProperty("valueInherited"));
 
// returns null ... expected
System.out.println(vertexFromDb.getPropertyKeys()); // returns [inherited, 
name] ... i would expect: [valueInherited, name]

assertNotNull("Property 'valueInherited' not found", 
vertexFromDb.getProperty("valueInherited")); // fails ... 
assertTrue(vertexFromDb.getProperty("valueInherited").equals(true));

I think, #2610 just focusing on the name in "metadata" (first two system 
out's), but the direct data value acess still needs the old key and 
getPropertyKeys()still returns old key. i would expect to access the data 
with the new key/name here!

best regards,
chris


Am Donnerstag, 24. Juli 2014 11:01:28 UTC+2 schrieb Lvc@:
>
> Hi,
> Seems the same of 
> https://github.com/orientechnologies/orientdb/issues/2610 I closed a few 
> hours ago. Please can you check it against 1.7.8-SNAPSHOT?
>
> Thanks,
> Lvc@
>
>
> On 24 July 2014 10:50, Chris Klinger <[email protected] 
> <javascript:>> wrote:
>
>> I did some tests playing with versions, Test Code see above:
>>
>> With OrientDb 1.6.6
>> OrientVertex vertexFromDb = graph.getVertex(vertex.getId());
>> System.out.println(vertexFromDb.getPropertyKeys()); // returns 
>> [inherited, name]
>> System.out.println(graph.getVertexType("Characteristic").getProperty("valueInherited").getName());
>>  
>> // returns valueInherited
>> System.out.println(graph.getVertexType("Characteristic").getProperty("inherited").getName());
>>  
>> // returns valueInherited
>>
>> assertNotNull("Property 'valueInherited' not found", 
>> vertexFromDb.getProperty("valueInherited")); => FAILS! (not expected)
>>
>> With OrientDb 1.7.7
>> OrientVertex vertexFromDb = graph.getVertex(vertex.getId());
>> System.out.println(vertexFromDb.getPropertyKeys()); // returns 
>> [inherited, name]
>> System.out.println(graph.getVertexType("Characteristic").getProperty("valueInherited").getName());
>>  
>> // returns valueInherited
>> System.out.println(graph.getVertexType("Characteristic").getProperty("inherited").getName());
>>  
>> // throws an NPE
>>
>> assertNotNull("Property 'valueInherited' not found", 
>> vertexFromDb.getProperty("valueInherited")); => FAILS! (not expected)
>>
>> It seems, that using a NoTx or Tx Graph makes no difference in 1.7.7, in 
>> 1.6.6 the TransactionGraph doesn't allow to create or change property types.
>>
>> I open a bug report on github 
>> https://github.com/orientechnologies/orientdb/issues/2617
>>
>> Am Freitag, 18. Juli 2014 17:25:53 UTC+2 schrieb Glenn Irwin:
>>
>>> I have also noticed this in 1.7.4 with the document database too.  If I 
>>> change a property name (using ALTER CLASS .. NAME ....) the data in that 
>>> column is lost.  If I change the column name back to the original name, the 
>>> data is back.
>>>
>>> Its almost like it is creating a new column instead of changing the 
>>> existing one.
>>>
>>> Very strange...
>>>
>>>  -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OrientDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to