• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Synchronizing detached POJOs

 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I have JTable whose model holding Detached Hibernate entities.
I read the entire DB table to the JTable model (approx 20 rows)
My user is working offline; remove rows, changes rows, etc,
How do I synchronize the detached objects to the db after my user commits his changes?
Do I have to implement the CRUD logic and dirty checking?
Thank you
Sharon
 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

My user is working offline; remove rows, changes rows, etc,



Implement dirty checking incase,
1. There are two or more users changing the "same" set of data offline.
&& 2. You need to inform the user that the data you are trying to change is not in the same state as it was when you read it. You might want to see the change which happened after you have read the data.

Use Update logic to update the changed set of data.
 
I just had the craziest dream. This tiny ad was in it.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic