Forum Stats

  • 3,851,377 Users
  • 2,263,968 Discussions
  • 7,904,690 Comments

Discussions

Content Management Problems with Escaped Text

655513
655513 Member Posts: 18
edited Oct 10, 2008 2:24PM in WebLogic Portal
I'm using the Content Management functionality built into the Portal Administration Console to store content into string field backed by an Oracle database.

If the content contains apostrophes (and is over 254 characters) it will not save, and instead gives a fairly cryptic error message that says the field is too long (expects 254 characters and got 256). If there are no apostrophes, any length of content submits correctly.

My guess is that the Content Management functionality is splitting the text into chunks of 254 characters and then escaping the apostrophes so they can be stored in the database. This would add a few characters to the character string, extending it past the max length. The recommendation would be to escape the content before splitting the text into chunks.

On a side note, this problem did not occur when running against Pointbase.

Comments

  • 655221
    655221 Member Posts: 116
    Could you post your portal version?
  • 655221
    655221 Member Posts: 116
    I forgot to say please.

    It sounds like a bug to me... the version number will make it easy on you if it ends up being a known issue with an existing patch.
  • 655513
    655513 Member Posts: 18
    Sorry.. I had the version number in before I went back and revised the text. Must have taken it out.

    I'm running 10.2 right now. We're beginning to look at 10.3 but I don't have it installed anywhere yet.
  • 648793
    648793 Member Posts: 96
    It is definitely a bug. You should open a support case.
  • 655221
    655221 Member Posts: 116
    It looks like, in WLP 10.2, the CM_PROPERTY_TEXT table was added to allow text properties longer than 254 chars.

    The CM_PROPERTY table has a TEXT_VALUE column that is defined as VARCHAR(254). This is where the first 254 chars of the text property are kept. The CM_PROPERTY_TEXT table has a TEXT_VALUE_EXT column that is defined as VARCHAR(3746) and that is where the rest of the chars are kept.

    It seems like the Content Management framework must be breaking the text value into two pieces: the first 254 chars and the rest of the chars. It is not the tools code that is doing that. Do you have the error message? A stack trace from the server log would be ideal.

    I'm wondering if the Content Management framework is counting the size of the first block of chars after escaping it and then throwing an exception because the escape char(s) puts it over the limit, even though the escape chars shouldn't count against the limit. It is strange, though, that it doesn't happen when using Pointbase. I tried it with the same result. Unfortunately, I don't have a connection to an Oracle DB on my test server at the moment so I didn't reproduce that part.

    I think WebLogicRocks is right that you should open a support case but could you also post the stack trace here for the sake of curiosity? If we are lucky, it might be easy to compare the stack trace to some source code and hand that to support to expedite a patch. It also might help the next person who runs into this.

    If you open a support case you might want to add these notes about the CM_PROPERTY and CM_PROPERTY_TEXT tables so that the frontline support engineer has a little head start.

    Thanks.
  • 655513
    655513 Member Posts: 18
    Interestingly enough, I'm not able to reproduce the problem anymore. My Oracle system was taken down for hardware maintenance soon after I reported the problem. Now that it's back up, everything seems to work fine. As far as I'm aware, there were no changes to the Oracle version, although there were OS level patches (Solaris 10).

    Looking back into my logs for the stack trace, this is what I found:

    com.bea.content.RepositoryException: java.sql.BatchUpdateException: ORA-12899: value too large for column "SCHEMA"."CM_PROPERTY"."TEXT_VALUE" (actual:
    256, maximum: 254)

    at com.bea.content.internal.server.common.dbaction.Batcher.processWithRetries(Batcher.java:132)
    at com.bea.content.internal.server.common.dbaction.Batcher.processAnyRemainingItems(Batcher.java:70)
    at com.bea.content.repo.internal.server.dao.PropertyDao.update(PropertyDao.java:533)
    at com.bea.content.repo.internal.server.persister.JDBCNodePersister.updatePropertyValues(JDBCNodePersister.java:271)
    at com.bea.content.repo.internal.server.logic.NodeOpsLogic.updateProperties(NodeOpsLogic.java:672)
    Truncated. see log file for complete stacktrace
    java.sql.BatchUpdateException: ORA-12899: value too large for column "SCHEMA"."CM_PROPERTY"."TEXT_VALUE" (actual: 256, maximum: 254)

    at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
    at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10698)
    at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:154)
    at com.bea.content.internal.server.common.dbaction.Batcher.processWithRetries(Batcher.java:114)
    at com.bea.content.internal.server.common.dbaction.Batcher.processAnyRemainingItems(Batcher.java:70)
    Truncated. see log file for complete stacktrace


    Based on the fact that I can no longer reproduce, I think it might be tough for me to open a bug. Let me know if you think it's still something that I should pursue. Thanks for the help.
  • 655221
    655221 Member Posts: 116
    Thanks for posting back w/ the stack trace. I'm a little surprised to see that the exception appears to be coming from the database. This implies (to me) that an insert statement with some escaped chars in the value were given to the DB for insertion and the DB counted escape chars in the total length. I'm no DB expert, not by a long shot, but that seems like a problem with the DB or the DB driver to me. I'll bring it up to the team that wrote the Content Management code to see if they can take a peek.

    I'm wondering if there was something unique about the string that you used to first reproduce this problem? Do you know if you are using the same exact string now?
  • 655221
    655221 Member Posts: 116
    I talked to someone on the Content Management team. They also think the evidence so far points to the database or database driver. If it starts happening again then you will probably want to give your configuration info and reproducer steps to support so they can help track it down.
  • 655513
    655513 Member Posts: 18
    Thanks again.

    I was able to get the problem to happen again - with a different piece of text (although the original one seems to work just fine now).

    I'll work to open up a ticket and point support at this thread.
This discussion has been closed.