Questions tagged [persistence]

Persistence in computer programming refers to the capability of saving data outside the application memory.

Persistence is the capability of saving data outside of application memory, and of retrieving it later for further processing.

Typically data can be stored into the file system, in flat files or in a database. But persistence can also involve sending data to external applications.

Often persistence is related to .

References.

5099 questions
30
votes
5 answers

How to save Scikit-Learn-Keras Model into a Persistence File (pickle/hd5/json/yaml)

I have the following code, using Keras Scikit-Learn Wrapper: from keras.models import Sequential from sklearn import datasets from keras.layers import Dense from sklearn.model_selection import train_test_split from keras.wrappers.scikit_learn import…
neversaint
  • 60,904
  • 137
  • 310
  • 477
30
votes
3 answers

Using javafx.beans properties in model classes

Is it a correct practice to use JavaFX beans properties in the model classes? I wonder if it is a good practice to use properties in model classes to be able to bind them easier with the view components. I'm not worried about the availability of…
Johnny
  • 1,509
  • 5
  • 25
  • 38
29
votes
4 answers

How to save to disk / export a lightgbm LGBMRegressor model trained in python?

Hi I am unable to find a way to save a lightgbm.LGBMRegressor model to a file for later re-use.
Utpal Datta
  • 367
  • 1
  • 3
  • 8
29
votes
4 answers

Primary Key Type: int vs long

I know some software shops have been burned by using the int type for the primary key of a persistent class. That being said, not all tables grow past 2 billions. As a matter of fact, most don't. So, do you guys use the long type only for those…
Tom Tucker
  • 11,676
  • 22
  • 89
  • 130
29
votes
3 answers

Firebase : What is the difference between setPersistenceEnabled and keepSynced?

I thought the whole time when I used the following all data for chat conversation will be available offline at any time. Which somehow isn't and all nodes are loaded from the server. FirebaseDatabase.getInstance().setPersistenceEnabled(true); Then,…
Relm
  • 7,923
  • 18
  • 66
  • 113
28
votes
4 answers

Writing Maven Dependency for javax.persistence

Can someone help me write the dependency for javax.persistence. I have googled it but nothing worked. I bumped into this page that gives some details on how to write the dependency, but yet i am unable to write it. Can someone help me out?
Illep
  • 16,375
  • 46
  • 171
  • 302
28
votes
2 answers

Spring: H2 Database persistence

My…
SteveOhio
  • 569
  • 2
  • 8
  • 20
28
votes
5 answers

Remember (persist) the filter, sort order and current page of jqGrid

My application users asked if it were possible for pages that contain a jqGrid to remember the filter, sort order and current page of the grid (because when they click a grid item to carry out a task and then go back to it they'd like it to be "as…
Jimbo
  • 22,379
  • 42
  • 117
  • 159
28
votes
1 answer

How to know if a detached JPA entity has already been persisted or not?

I have a JPA entity instance in the web UI layer of my application. I'd like to know at anytime if this entity has been already persisted in database or if it is only present in the user session. It would be in the business layer, I would use…
snowflake
  • 1,750
  • 2
  • 17
  • 40
28
votes
8 answers

ehcache persist to disk issues

I want to do something with ehcache in Java that I think should be extremely simple, but I've spent enough time frustrating myself with the docs... Write a value to a disk persistent cache. Shut down. Start up again and read that value. Here is my…
hross
  • 3,633
  • 2
  • 27
  • 31
28
votes
5 answers

JAVA: an EntityManager object in a multithread environment

if I have multiple threads, each use injector to get the EntityManager object, each use the em object to select a list of other class objects. Ready to be used in a for loop. If a thread finishes first and calls clear(), will that affect the other…
user1589188
  • 5,316
  • 17
  • 67
  • 130
27
votes
1 answer

Firestore - Using cache until online content updates

I am starting with Firestore. I've read docs and tutorials about the offline data persistence but I have not really clear if Firestore downloads data again even if the content hasn't been modified. For example, if I have a query where the results…
27
votes
4 answers

what is the right path to refer a jar file in jpa persistence.xml in a web app?

persistence.xml looks like this: org.hibernate.ejb.HibernatePersistence jdbc/test
Bobo
  • 8,777
  • 18
  • 66
  • 85
27
votes
3 answers

JPA/Hibernate bulk(batch) insert

Here is simple example I've created after reading several topics about jpa bulk inserts, I have 2 persistent objects User, and Site. One user could have many site, so we have one to many relations here. Suppose I want to create user and create/link…
Andriy Kopachevskyy
  • 7,276
  • 10
  • 47
  • 56
27
votes
3 answers

How to do multiple column UniqueConstraint in hbm?

Working on some legacy hibernate code. How do I do the following with hbm.xml(hibernate mapping file) instead of with annotations? @Table(name="users", uniqueConstraints = { @UniqueConstraint(columnNames={"username", "client"}), …