Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
Adobe Summit 2023 | Complete list of AEM Sessions & Labs

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

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