Hello Vítor,

On May 14, 2014, at 11:07 AM, Vítor Rui Moreira <mkw_vmore...@brisa.pt> wrote:

> I don't know if it's the correct mailing list to ask this but it's code 
> related.
> 
> I've got several issues in "Notice List" in webapp: the notifications 
> are displayed incorrectly (my notifications are HTML-based). After 
> seeing the database and logs from "notifd.log", I saw quote a 
> difference: in DB, the text was truncated at 4000 chars but in the log, 
> the text wasn't truncated. The DB, in table "notifications", column 
> "textmsg" is "text", with size 2147483647.
> 
> So, I thought the problem was when writing the notification to the DB. 
> After inspecting class "OnmsNotification", the "getTextMsg()" method is 
> annotated with "@Column(length=4000)".
> 
> I'm using ONMS 1.8.17 in production, 1.12.5 in development. In both 
> versions, the annotation exists.
> 
> Finally, the question: is there a reason to add this constraint 
> "@Column(length=4000)" to the method?
> 
> Sorry about my english... :-)

The length of @Column annotation is used by Hibernate to create the schema, it 
is not used to limit the content of a specific column. For that purpose there 
is another annotation called @Limit.

The thing is that the code that create the notifications doesn't use 
NotificationsDao because that is one of the oldest part of the code, and it is 
pure JDBC.

The problem is related with the method: 
org.opennms.netmgt.config.NotificationManager.insertNotice(int, Map<String, 
String>, String, Notification):

https://github.com/OpenNMS/opennms/blob/1.12/opennms-config/src/main/java/org/opennms/netmgt/config/NotificationManager.java

Inside its implementation(around line 778) you can see the 4000 characters 
limitation, so you've found a bug:

It should not be difficult to fix, but I suggest to at least open a Jira issue 
for this on jira.opennms.org

Alejandro.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

Reply via email to