Expand my Community achievements bar.

Flex and Java

Avatar

Level 2
When java throw a DB exception, I can see the message on the
lcds terminal, but how can I get this message in my flex app to
show user a friendly message of what hapenning.



By ex:



When my user try to delete data that resulting in a
ForeignKey constraint, I want to tell him that he can't do that
without first deleting associated data to this one. But, lcds just
delete the item in my arraycollection, let's the user think it's
deleted but in the database, nothing get deleted, normal, and in
the lcds terminal throw an exception coming from Java.



From now I try these:



DS = new DataService("DS");

DS.addEventListener(DataServiceFaultEvent.FAULT, themeFault);

DS.addEventListener(DataConflictEvent.CONFLICT,
themeConflict);

DS.addEventListener(MessageEvent.MESSAGE, themeMessage);



But nothing is throw for:



com.microsoft.sqlserver.jdbc.SQLServerException: The DELETE
statement conflicted

with the FOREIGN KEY constraint
"FK_tblCongres_tlkpCategorieTheme". The conflic

t occurred in database "Congres", table
"dbo.tlkpCategorieTheme", column 'ID'.

at
com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError

(Unknown Source)



I want to catch this message and tell my user that he can't
delete at this point.



Somebody know what I'm talking about?
2 Replies

Avatar

Former Community Member
When the server throws the error, do you get anything on the
client? You should get a fault event on the client.

Avatar

Level 2
No I don't get anything on the client side over the
FaultEvent