There is no insanity so devastating in man's life as utter sanity
If our main application is using a persistence layer and a utility writes data directly to the database does the persistence layer know that it needs to get the new data?
If not how would one go about telling it to refresh specific data?
If you are not laughing at yourself, then you just didn't get the joke.
Arun Kumarr wrote:
-- No, It wouldn't. Peristence layers however would be mature enough to do a select-before-update, automatic version checking and report a stale state exception to your application
which you can handle elegantly.
There is no insanity so devastating in man's life as utter sanity
If you are not laughing at yourself, then you just didn't get the joke.
Tim Sparg wrote:Hi all
I'm investigating the use of JPA for a rewrite of our main application.
We have a main application that our clients use, and then multiple utility applications that read data from the database and send it of, or receive data and write it to the database.
If our main application is using a persistence layer and a utility writes data directly to the database does the persistence layer know that it needs to get the new data?
If not how would one go about telling it to refresh specific data?
Ran
Ran Pleasant wrote:
About 8 or 10 years back I worked on a Swing application that displayed live stock trades for analysts of a company with a seat on the New York Stock Exchange, those analysts needed the freshest data possible. The primary model of my swing application was updated by a thread that listened constantly to a socked connection to an application written in C++. My understanding was that the C++ application was connected to some type of Oracle queue. When new data was entered into a specific table on the Oracle database it would post a message on the queue. The C++ application would then read the new data and push it up the socket to my application. Please note that I never saw the C++ application and really don't know how it was connected to Oracle. However, I do know that when new stock information hit the Oracle database a couple of seconds later it would appear in my Swing applications.
If you are using Oracle you might talk to your DBA to see how all of that might work for you.
There is no insanity so devastating in man's life as utter sanity
• JPA seems to need exclusive access to the database - this is just not a reality for us, as we have several applications that directly insert data into the database.
• We need fresh data - Following on from the above there is no easy way to get fresh data from the database.
• Entity generation doesn't work - Automated entity creation either hangs (I've tried Netbeans,Eclipse,Jboss Developer) or creates an invalid database schema. I would rather create all of those entities myself than actually have to go and check that they are correct.
• Views are second class citizens - We use views everywhere, and in order to get views to work correctly you need to modify the entity thats generated.
• Read from view update to table - We often read from views and then update back to the table, again there doesn't seem to be an easy way to do this.
• Entity joins are a bit of a misnomer - This is perhaps a bit less concrete than the others but just as important. Entites are created with joins to other tables/entites. This works well if you are doing all of your work on the the server/JPA tier however the moment that you have an entity that is remote from that tier and try to follow a non eager join then everything falls apart. (blob is a perfect example)
SCJP 1.6, OCEEJB 6, OCEJPA 6
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|