Questions tagged [transient]

In ORM and OOP , a transient field is generally a field that isn't included in the serialization process. Use this tag for questions related to behavior related to the transient keyword.

414 questions
0
votes
2 answers

Does hibernate Session.save attempts to save 'all' transient entities?

I have an entity with a primary key and a unique constraint as below @Entity @Table(name = "EMPLOYEE") public class Employee { @Id @GeneratedValue @Column(name = "ID", nullable = false) private Integer id; @Column(name = "NAME") private String…
Sampath
  • 103
  • 1
  • 8
0
votes
3 answers

Is determining what is transient a trial and error?

Assume I create a class Foo, whose instance variables are instances of different class's. Eg: class Foo implements Serializable { BarA barA; BarB barB; . . BarZ barZ; } I understand that when I serialize, I need to all the Bar's to…
JavaDeveloper
  • 5,320
  • 16
  • 79
  • 132
0
votes
2 answers

Correct practice to handle thread containing transient members in serialized classes

I have some serialized classes which have several members that are classes that initiate some life-long threads.(while(true){doSth();sleep(100)}). Now I wonder which is a good practice to handle them. Wether I should create those objects by…
Johnny
  • 1,509
  • 5
  • 25
  • 38
0
votes
1 answer

transient variable is null after org.apache.catalina.core.StandardContext reload

I have a variable in a class that is transient because it is not serialize, only when the tomcat is org.apache.catalina.core.StandardContext reload this same variable is null, don't know why ... public class bean extends UnicastRemoteObject…
user2989745
  • 149
  • 1
  • 3
  • 12
0
votes
2 answers

Write to disk an object that contains a BufferedImage

I have an object BatchState that has pointers to a number of pieces of data, including a BufferedImage. I need to serialize the object. Here's a simplified version of my BufferedImage: public class BatchState implements Serializable{ private int…
Benjamin
  • 1,372
  • 2
  • 12
  • 20
0
votes
1 answer

Hibernate lazy-load transient fields

I expect that this is an unusual use-case. Say I have a entity class Foo: @Entity public class Foo { @Id private Long id; private String bar; @Transient private long bazz; ... } I also have an Interceptor defined such…
Adam Maass
  • 931
  • 1
  • 6
  • 6
0
votes
1 answer

tkinter Toplevel window appears not to react to some methods

I have code for selecting backup that should be loaded. It opens Toplevel window and lets you select one of the backups to load. When this window opens, I would like to block input to original window, so the only way to get back to original window…
user1687327
  • 176
  • 1
  • 9
0
votes
1 answer

NHibernate: many-to-many relation fails to save child objects first (either: "cannot insert null" or: "transient object")

I have a consignment class that aggregates a FreightDateTime class. At the same time, the FreightDateTime class is also aggregated by the GoodsItem class. In the same manner, FreightDateTime is associated with a number of other classes that I left…
Fedor Alexander Steeman
  • 1,561
  • 3
  • 23
  • 47
0
votes
2 answers

Why google-collections AbstractMultimap class use transient keyword for member variable?

https://code.google.com/p/google-collections/source/browse/trunk/src/com/google/common/collect/AbstractMultimap.java?r=117 AbstractMultimap is implements Serializable. In my eyes actual datas are saved to map and totalSize variables. But both…
thanksnote
  • 1,012
  • 11
  • 9
0
votes
1 answer

WordPress | Transient the default WP_Query results

I have create a web site with a lot of traffic, and I have use the WordPress transients in order to "cache" the requested data. Until here all are fine with my custom made queries and usage of WP_Query. The question that I have, is how can I "cache"…
KodeFor.Me
  • 13,069
  • 27
  • 98
  • 166
0
votes
2 answers

JPA and Serialization behaviour

Basically, i want to make a JPA-persisted field in my Entity behave like it is transient on manual serialization i have a basic class like this: @Entity public class Foo implements Serializable{ @Id …
Simiil
  • 2,281
  • 1
  • 22
  • 32
0
votes
1 answer

About the life of transient attributes in entity of core data

I has a question that. I need a runtime attribute in MyEntity, it is changed very offen. And there are many MyEntity in core data.(such as 1000,0000); I know that the transient attribute wont be saved in the disk, so these 1000,0000 MyEntities must…
0
votes
1 answer

NHibernate: set entity from transient object based on unique field

My application obtains transient objects. MyClass Id Name OtherData Mapping is like Id is identifier and Name has unique constraint in database. The transient object has no Id yet of course, but has fulfilled Name property and all other…
Petr Felzmann
  • 1,271
  • 4
  • 19
  • 39
0
votes
1 answer

SQL Azure - what happens with nested transient error handlind?

I'm starting to use the transient fault block provided by Microsoft for SQL Azure and I'm noticing that some of my functions which have a transient handled block may have reference to other functions with this block also. I am guessing that the…
Le-roy Staines
  • 2,037
  • 2
  • 22
  • 40
0
votes
0 answers

how to use managedBean created before page navigation

Page foo.xhtml -------------- ... @ViewScoped("fooBean") public class FooBean { private boolean _transient = false; public void setTransient(boolean t) { _transient = t; …
Dave
  • 487
  • 1
  • 6
  • 19