Property "cm:title" duplicated on database : NodeService return wrong value

cancel
Showing results for 
Search instead for 
Did you mean: 
oounoughi
Established Member

Property "cm:title" duplicated on database : NodeService return wrong value

I have problème on some instances of alfresco when we update the title of documents, we always get the first title set when we use :

nodeServive.getProperty(node, ContentModel.PROP_TITLE); //return wrong value

Exemple :

  • Update document
  • Set title to value : "First title"
  • Update title to value : "Latest title"
  • Get property title with NodeServive
    • Expected value: "Latest title"
    • value returned : "First title"


But in Share, ReST API (getNode) , NodeBrowser and JavaScript  we get the expected value (latest value)

var title = document.properties['cm:title']; //return good value


When investigating the problem, I found out the only place the first value of the title remain is in database, using this query :

SELECT n.id AS "Node ID",
  n.uuid AS "Document ID (UUID)",
  p1.string_value AS "Document Name",
  p2.string_value AS "Title"
FROM alf_node AS n,
  alf_node_properties AS p,
  alf_node_properties AS p1,
  alf_node_properties AS p2,
  alf_namespace AS ns,
  alf_qname AS q,
  alf_content_data AS d,
  alf_content_url AS u
WHERE n.id=p.node_id
  AND ns.id=q.ns_id
  AND p.qname_id=q.id
  AND p.long_value=d.id
  AND d.content_url_id=u.id
  AND p1.node_id=n.id
  AND p1.qname_id IN (SELECT id FROM alf_qname WHERE local_name='name')
  AND p2.node_id=n.id
  AND p2.qname_id IN (SELECT id FROM alf_qname WHERE local_name='title')
  AND n.uuid=' fa7d43b4-78e5-4f3e';


the result we find two titles :

Spoiler
+----------+--------------------------------------+---------------------+-----------+
| Node ID | Document ID (UUID) | Document Name | Title |
+----------+--------------------------------------+---------------------+-----------+
| 10493706 | fa7d43b4-78e5-4f3e | 07-N.S. 1207002.pdf | New Title |
| 10493706 | fa7d43b4-78e5-4f3e | 07-N.S. 1207002.pdf | Info-119 |
+----------+--------------------------------------+---------------------+-----------+
2 rows in set (1 min 45.42 sec)

In envirement without the problem, it's expeted to have always one value

Even when we update multiple times, the query results always have 2 results, with the first title value never changing;

I can't give instruction how to repreduce the problem but I got it 3 intances of ACS

Is there a configuration to solve this problem or an alternative in Java to get the expected value ?


Thanks in advance,

Regards,