Thank you Hartmut for your reply.
Well, you said my programming environment is misconfigured but I can't see 
how.
I've forgot to mention my enviroment specifications:
OS: Linux distro openSuse 13.2
Oracle java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
Orientdb 2.0.10 (but I've tested previous versions too).
Programming language PHP 5.6.7
I've tried PhpOrient driver (binary protocol) and Orientdb-ODM either (rest 
protocol)
I've tried to figure out if it is the driver which triggers the issue but 
it doesn't seem so.
I get the same behaviour from binary as well as from rest protocol too.

Studio acts in the same way and I get the same exact result from console.sh

I've wrote a similar script of yours but using PHP (PhpOrient driver):

require "vendor/autoload.php";
use PhpOrient\PhpOrient;

$client = new PhpOrient( 'localhost', 2424 );
$ClusterMap = $client->dbOpen( 'joshua4', 'admin', 'admin' );

$some_object=array(
    "stange_text"=>"some \ text"  
);

$strange_text=json_encode($some_object);

echo "Original text: ".$some_object['stange_text'].PHP_EOL;
echo "OBJ json encoded: ".$strange_text.PHP_EOL;

$ret=$client->command($sql="update person set test = $strange_text where 
name = 'bob'");

echo "SQL command: ".$sql.PHP_EOL;

echo "Command return:".PHP_EOL;
var_dump($ret);

$ret=$client->query( 'select test from person where name = "bob"' );

$vertex=$ret[0]->getOData();

$res=($i['test']['stange_text']===$some_object['stange_text']);

echo "Match texts result:".PHP_EOL;
var_dump($res);

echo "Returned record:".PHP_EOL;
var_dump($vertex);

and this is the output:

Original text: some \ text
OBJ json encoded: {"stange_text":"some \\ text"}
SQL command: update person set test = {"stange_text":"some \\ text"} where 
name = 'bob'
Command return:
string(1) "1"
Match texts result:
bool(false)
Returned record:
array(1) {
  'test' =>
  array(1) {
    'stange_text' =>
    string(12) "some \\ text"
  }
}



Any idea where it can be the misconfiguration? I haven't any clue.
Excluding drivers and PHP (because I'm noticing the same behaviour from 
Studio and console.sh) I've supposed it was the SQL parser of the DBMS 
acting wrongly.

It heppens not just on my developing machine but even on the production 
system.



On Tuesday, June 16, 2015 at 2:43:05 PM UTC+2, hartmut bischoff wrote:
>
> tried to verify your problem
>
> wrote the following [quick&dirty] test (in my ruby-parser)
>
>
> 180     it "update strange text", focus:true do
> 181       strange_text = { strange_text: "'@type':'d','a':'some \\ text'"}
> 182 
> 183       res=  @r.create_or_update_document o_class: @rest_class , set: { 
> a_new_property: 36 } , where: {con_id: 346, symbol: 'EWQrGZ' } do
> 184           strange_text   # <<< ----- strange text is inserted into the 
> database
> 185       end
>            ## res is the response from the database 
> 186       expect( res.strange_text ).to eq strange_text[:strange_text]
>            ## lets be shure, reload the document by using the rid 
> 187       document_from_db =  @r.get_document res.rid
>            ## and perform the test once more
> 188       expect( document_from_db.strange_text ).to eq 
> strange_text[:strange_text]
> 189     end
>
> 14:35:51 - INFO - Running: spec/lib/rest_spec.rb
> Run options: include {:focus=>true}
>
> REST::OrientDB
>   document-handling
> D, [2015-06-16T14:35:53.037385 #89231] DEBUG -- REST::Base#initialize: 
> property a_new_property assigned to REST::Model::Documebntklasse10
> D, [2015-06-16T14:35:53.037697 #89231] DEBUG -- REST::Base#initialize: 
> property con_id assigned to REST::Model::Documebntklasse10
> D, [2015-06-16T14:35:53.037967 #89231] DEBUG -- REST::Base#initialize: 
> property symbol assigned to REST::Model::Documebntklasse10
> D, [2015-06-16T14:35:53.038185 #89231] DEBUG -- REST::Base#initialize: 
> property strange_text assigned to REST::Model::Documebntklasse10
>     update strange text
>
> Finished in 1.21 seconds (files took 0.34114 seconds to load)
> 1 example, 0 failures
>
>
> Anything works fine.
>
> Thus – your programming environment is not setup correctly
>
>
> p.s.
> The ruby-interface handles the json-conversion with 
> standard-equipment:  URI.encode does the transformation of incomming 
> messages and content.to_json does the work for outgoing messages.  I don't 
> think that ruby librarys differ much from those of other languages.
>

-- 

--- 
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