Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > What does "persist" really mean ?

Reply
Thread Tools

What does "persist" really mean ?

 
 
Sébastien de Mapias
Guest
Posts: n/a
 
      07-30-2008
Hi,
If I check Spring's doc of HibernateTemplate save(Object) method,
it says that it "persists the given transient instance". What does
this mean ??

Thanks.
SR

 
Reply With Quote
 
 
 
 
Uwe Schmitt
Guest
Posts: n/a
 
      07-30-2008
On 30 Jul., 10:47, Sébastien de Mapias <(E-Mail Removed)> wrote:
> Hi,
> If I check Spring's doc of HibernateTemplate save(Object) method,
> it says that it "persists the given transient instance". What does
> this mean ??
>
> Thanks.
> SR


persisting an object means converting its state to a representation
which will be saved to a db, filesystem, ...
later on you can load the representation and reconstruct the object
again.

the task of converting an objects state is called 'serialization'.
the representation can be in xml which is quite verbose, or in some
other ascii or binary format.

you can pass serialized objects through a network to some other
machine, where it is reconstructed again.
see http://java.sun.com/javase/technolog.../rmi/index.jsp

greetings, uwe
 
Reply With Quote
 
 
 
 
RedGrittyBrick
Guest
Posts: n/a
 
      07-30-2008
Sébastien de Mapias wrote:
> Hi,
> If I check Spring's doc of HibernateTemplate save(Object) method,
> it says that it "persists the given transient instance". What does
> this mean ??
>


I usually interpret that as to write to disk or some other non-volatile
medium which will retain the data if the Java program exits. Furthermore
to do so in such a way that the Java application can read the data when
it is restarted. I usually think in terms of persisting across a power
shut-down, though I suppose the term could be used in the context of
more volatile storage external to the application.

In the case of Spring/Hibernate I bet in 99% of cases it means it will
issue an SQL insert or update statement to a nearby DBMS.

I imagine "transient instances" are instances of Java classes (i.e.
objects) that are in peril if you pull the power cord out the back of
the computer.

Or have I misunderstood the question?

--
RGB
 
Reply With Quote
 
Sébastien de Mapias
Guest
Posts: n/a
 
      07-30-2008
> In the case of Spring/Hibernate I bet in 99% of cases it means it will
> issue an SQL insert or update statement to a nearby DBMS.


OK in this case 'save()' does not really "persist" the object *yet*,
until I commit, isn't it ? So the doc is rather unsufficient, am I
mistaken ? (I'm dealing with a database indeed)

To answer Eric Sosman: it's indeed the transitive usage of PERSIST
that made me misunderstand its meaning here (and there are many
other english words I'm not at ease with, because of their usage
in informatics -"leverage" is an example...-).

Thanks.
Seb

 
Reply With Quote
 
Tom Anderson
Guest
Posts: n/a
 
      07-30-2008
On Wed, 30 Jul 2008, Lew wrote:

> Uwe Schmitt wrote:
>> the task of converting an objects state is called 'serialization'.
>> the representation can be in xml which is quite verbose, or in some

>
> But probably less verbose than java.io.Serializable serialization.


Really? I'll run some tests ...

>> other ascii or binary format.

>
> XML being "verbose" is one of those semi-true urban legends.


My take on it is that it is true until you compress your stream, at which
point it becomes very much not true.

> "Verbose" compared to what?


ASN.1.

> And at what benefit?


None.

tom

--
10 PARTY : GOTO 10
 
Reply With Quote
 
Mike Schilling
Guest
Posts: n/a
 
      07-30-2008
Tom Anderson wrote:
> On Wed, 30 Jul 2008, Lew wrote:
>
>> Uwe Schmitt wrote:
>>> the task of converting an objects state is called 'serialization'.
>>> the representation can be in xml which is quite verbose, or in
>>> some

>>
>> But probably less verbose than java.io.Serializable serialization.

>
> Really? I'll run some tests ...


Try comparing the Swing Archiver to serialization. Brcause the former
only stores properties that have non-default values, where
serialization stores every single non-transient field, it can result
in much smaller persistent formats.


 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      07-30-2008
Lew asked:
> > "Verbose" compared to what?


Tom Anderson wrote:
> ASN.1.


Lew:
> > And at what benefit?


Tom:
> None.


XML has many benefits as an serialization format, not least that it is
semantically void. It is also human-readable. I am not familiar with
ASN.1, which may have similar advantages.

XML is also infinitely extensible and self-describing. The verbosity
buys something.

--
Lew


 
Reply With Quote
 
Stefan Ram
Guest
Posts: n/a
 
      07-30-2008
Sébastien de Mapias <(E-Mail Removed)> writes:
>If I check Spring's doc of HibernateTemplate save(Object) method,
>it says that it "persists the given transient instance". What does
>this mean ??


It means to save.
¯¯¯¯
This might be an example, where the method name says more
than the documentation.

Which reminds me of a note, where someone recently wrote
»When I get a piece of code I need to understand, the first
thing I do is to strip all commments.«

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-31-2008
On Wed, 30 Jul 2008 01:47:57 -0700 (PDT), Sébastien de Mapias
<(E-Mail Removed)> wrote, quoted or indirectly quoted someone who
said :

>If I check Spring's doc of HibernateTemplate save(Object) method,
>it says that it "persists the given transient instance". What does
>this mean ??


see http://mindprod.com/jgloss/persistence.html
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Tom Anderson
Guest
Posts: n/a
 
      07-31-2008
On Wed, 30 Jul 2008, Lew wrote:

> Lew asked:
>>> "Verbose" compared to what?

>
> Tom Anderson wrote:
>> ASN.1.

>
> Lew:
>>> And at what benefit?

>
> Tom:
>> None.

>
> XML has many benefits as an serialization format, not least that it is
> semantically void.


"Semantically void"?

> It is also human-readable. I am not familiar with ASN.1, which may have
> similar advantages.


Well, it's certainly not human-readable [1]. Nor, sadly, is its
specification!

> XML is also infinitely extensible and self-describing. The verbosity
> buys something.


ASN.1 has the same degree of self-describingness as XML. The two are
really very similar when you get down to it. Indeed, there is a degree of
interoperability:

http://asn1.elibel.tm.fr/xml/

tom

[1] Kinda. ASN.1 is actually not an encoding, but a sort of framework for
encoding, within which there are a few specific encodings. The standard
one is the Basic Encoding Rules, BER, which is binary, fairly compact, and
self-describing. There's also the Packed Encoding Rules, PER, which is
maximally compact, but not self-describing. I think there are also
human-readable formats (there's certainly an XML one), but that's not
usually what people mean when they say ASN.1.

--
roger and kay payne, symmetry, piercing, archaeology, position, in ,,
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
icmp weirdness - PIX 501 (does any really mean any??) news8080@yahoo.com Cisco 2 09-23-2005 04:04 PM
What does "formatted" I/O really mean? Steven T. Hatton C++ 2 08-01-2005 10:13 AM
What does Lossless really mean? Freedom55 Digital Photography 15 07-01-2005 04:51 PM
What the heck does APS really mean? Charles Schuler Digital Photography 10 03-06-2004 07:08 AM
What does the keyword 'global' really mean John Dean Python 5 09-09-2003 02:58 PM



Advertisments