100% found this document useful (4 votes)
71 views

Full download Mastering Java Persistence API (JPA): Realize Java's Capabilities Spanning RDBMS, ORM, JDBC, Caching, Locking, Transaction Management, and JPQL (English Edition) Kurur pdf docx

Capabilities

Uploaded by

gerentvotali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
71 views

Full download Mastering Java Persistence API (JPA): Realize Java's Capabilities Spanning RDBMS, ORM, JDBC, Caching, Locking, Transaction Management, and JPQL (English Edition) Kurur pdf docx

Capabilities

Uploaded by

gerentvotali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Get ebook downloads in full at ebookmeta.

com

Mastering Java Persistence API (JPA): Realize


Java's Capabilities Spanning RDBMS, ORM, JDBC,
Caching, Locking, Transaction Management, and JPQL
(English Edition) Kurur
https://ebookmeta.com/product/mastering-java-persistence-
api-jpa-realize-javas-capabilities-spanning-rdbms-orm-jdbc-
caching-locking-transaction-management-and-jpql-english-
edition-kurur/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Cambridge IGCSE and O Level History Workbook 2C - Depth


Study: the United States, 1919-41 2nd Edition Benjamin
Harrison
https://ebookmeta.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-
benjamin-harrison/
ebookmeta.com

Rapid Java Persistence and Microservices 1st Edition Raj


Malhotra

https://ebookmeta.com/product/rapid-java-persistence-and-
microservices-1st-edition-raj-malhotra/

ebookmeta.com

Java Persistence with Spring Data and Hibernate (MEAP V04)


C■t■lin Tudose

https://ebookmeta.com/product/java-persistence-with-spring-data-and-
hibernate-meap-v04-catalin-tudose/

ebookmeta.com

The Wicked Wallflower The Duchess Society 3 1st Edition


Tracy Sumner

https://ebookmeta.com/product/the-wicked-wallflower-the-duchess-
society-3-1st-edition-tracy-sumner/

ebookmeta.com
Raspberry Pi Assembly Language Programming 1st Edition
Stephen Smith

https://ebookmeta.com/product/raspberry-pi-assembly-language-
programming-1st-edition-stephen-smith/

ebookmeta.com

Proceedings of 6th International Conference on Harmony


Search Soft Computing and Applications ICHSA 2020 Istanbul
1275 Advances in Intelligent Systems and Computing 1275
Sinan Melih Nigdeli (Editor)
https://ebookmeta.com/product/proceedings-of-6th-international-
conference-on-harmony-search-soft-computing-and-applications-
ichsa-2020-istanbul-1275-advances-in-intelligent-systems-and-
computing-1275-sinan-melih-nigdeli-editor/
ebookmeta.com

The Rulers of Darkness II Miracle Deliverance Ministry


F3Thinker

https://ebookmeta.com/product/the-rulers-of-darkness-ii-miracle-
deliverance-ministry-f3thinker/

ebookmeta.com

Programming Languages Application and Interpretation


printing Shriram Krishnamurthi

https://ebookmeta.com/product/programming-languages-application-and-
interpretation-printing-shriram-krishnamurthi/

ebookmeta.com

A Guide to the Formulation of Plans and Goals in


Occupational Therapy 1st Edition Sue Parkinson Rob Brooks

https://ebookmeta.com/product/a-guide-to-the-formulation-of-plans-and-
goals-in-occupational-therapy-1st-edition-sue-parkinson-rob-brooks/

ebookmeta.com
Theoretical Computer Science for the Working Category
Theorist Noson S. Yanofsky

https://ebookmeta.com/product/theoretical-computer-science-for-the-
working-category-theorist-noson-s-yanofsky/

ebookmeta.com
Mastering
Java Persistence API (JPA)

Realize Java's Capabilities Spanning


RDBMS,
ORM, JDBC, Caching, Locking, Transaction
Management, and JPQL

Nisha Parameswaran Kurur

www.bpbonline.com
FIRST EDITION 2022
Copyright © BPB Publications, India
ISBN: 978-93-55511-263

All Rights Reserved. No part of this publication may be reproduced, distributed or transmitted in any
form or by any means or stored in a database or retrieval system, without the prior written permission
of the publisher with the exception to the program listings which may be entered, stored and executed
in a computer system, but they can not be reproduced by the means of publication, photocopy,
recording, or by any electronic and mechanical means.

LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY


The information contained in this book is true to correct and the best of author’s and publisher’s
knowledge. The author has made every effort to ensure the accuracy of these publications, but
publisher cannot be held responsible for any loss or damage arising from any information in this
book.
All trademarks referred to in the book are acknowledged as properties of their respective owners but
BPB Publications cannot guarantee the accuracy of this information.

www.bpbonline.com
Foreword
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.
– Robert Frost

The above lines from the poem “Stopping by Woods on a Snowy Evening”
by Robert Frost always propel me. I think this is true for every professional,
aspirant, and whoever wants to be a part of the industry. I believe learning
is an endless journey for everyone; sometimes we learn from the
experienced fellows the other time even a kid teaches us in a new way. The
important point is learning and it does not matter from whom we are
grabbing the skills. This book expounds on the above quote, and I must say,
you will praise yourself once you read this book.
James Gosling, Mike Sheridan, and Patrick Naughton – a great team gave
us a gift of live-long technology (language and framework). It is now more
than two decades since the first stable release of Java in the year 1995. Java
is still famous and popular among many industries. However, there are
many new adaptions and additions we have now in Java but the base
fragrance of Java is the same. Gradually, this language is coming with more
and more features. You have to update yourself if you want to swim in the
ocean. The current book is very helpful for you to build your basic blocks
with the latest terminology, additions and/or updates in this language.
I appreciate the style of the author how she curated and assembled the book.
This book meets its purpose as layout by the author. The author has built the
basic blocks of the widely used topics in a detailed manner, and are:
Object Relational Mapping.
Database terminologies and their abstracts
What’s new in the language?
Runtime objects
The author has started with theory to define the basic concepts and visualize
them in the form of dynamic diagrams. In the mid of the book, you will
know the terminologies that can be used even with the help of short/tiny
examples. In the final phase of the book, the author presents the difference
between old and new versions. These are defined in very simple examples
and in the form of images/diagrams so that one can easily grab these
concepts. Additionally, the author has provided an appendix where you can
find the solutions to the problems. Apart from this, every chapter has
assessment sections so that the readers can assess themselves after going
through a chapter.
This book is built with basic blocks and can be a ready reckoner for any
professional or student. You'll learn and understand them theoretically to
implement various topics. After reading this book, you will realize that you
are now ready to learn advanced things and if you know the advanced
concepts already, then you will find yourself refreshed with the
additions/updates that we have in the current version of the language.
I hope you appreciate this book as much as I did. And I hope you enjoy
working on database analysis.
Enjoy!

Dr. Gaurav Aroraa


New Delhi, India
Dedicated to
My beloved parentse
&
My cherished family
About the Author
Nisha Parameswaran Kurur is a technical architect with a wide range of
interests, including topics such as databases, algorithms, data structures,
operating systems, and networking principles. She has worked on numerous
real-world application projects for large clients in various domains like
networking, broadcast, retail, finance, healthcare, etc. with different
companies including services as well as product sectors from the IT
industry. She earned her Master's Degree in Computer Science from the
Indian Institute of Technology Madras (IITM), Chennai, India and has
published conference papers and white papers. She is also a specialized
coding skills instructor for courses conducted by ASAP, Kerala
Government. She is deeply interested in propagating her knowledge to
wider audiences and hence is involved in authoring books in local
languages for non-technical people (with a great focus on next-generation
kids) who have the interest to learn computer subjects.
About the Reviewers
Gaurav Aroraa is a tech enthusiast and technical consultant with more
than 23 years of experience in the industry. He has a Doctorate in Computer
Science. Gaurav is a Microsoft MVP award recipient. He is a lifetime
member of the Computer Society of India (CSI), an advisory member and
senior mentor at IndiaMentor, certified as a Scrum trainer and coach, ITIL-
F certified, and PRINCE-F and PRINCE-P certified. Gaurav is an open-
source developer and a contributor to the Microsoft TechNet community.
He has authored books across the technologies, including Microservices by
Examples Using .NET Core (BPB Publications).
Blog links: https://gaurav-arora.com/blog/
LinkedIn Profile: https://www.linkedin.com/in/aroragaurav/

Abhijeet Prakash has 6 years of extensive experience in Artificial


Intelligence, Machine Learning, NLP, Deep Learning and Full Stack
Development using tools like Cookiecutter, KerasTuner, DVC, Google
Cloud Video API, Selenium, BS, Google Colab, Apigee, FastAPI, AWS,
Google Cloud Platform with programming languages like Ruby, Node,
Python, etc. with a demonstrated history of working in information
technology and product-based companies.
Abhijeet has pursued MCA from the Department of Mathematical Science
and Information Technology, B.U. He has worked with various banks,
NBFCs, and Fin-Tech companies. He has worked as Machine Learning
Engineer and is currently working as an Artificial Intelligence Engineer.
Abhijeet has also written a book on Ethical Hacking.
Acknowledgement
There are quite a few people I want to thank for the continued and ongoing
support they have given me. First and foremost, I would like to thank my
parents for their vision and motivation, without which I would not have
been what I am today. Next, I would like to thank my family for their
whole-hearted and continuous encouragement and support, which has
always been my pillar of strength. A special note of thanks to my kids for
actively participating in my book writing activities by helping me in
creating diagrams.
Words fall short to explain my appreciation to my friends and teachers,
right from my school to my masters, who shaped me into the person I am
now. I am grateful to all my colleagues and employers (current and
previous) who gave me various opportunities to learn and grow.
My gratitude extends to the team at BPB Publications for handing over such
a huge responsibility and being supportive enough to provide me with quite
a long time to finish the book. Covid-19 pandemic and other personal
interruptions kept me away from the book writing process for more time
than expected. Kudos to the book coordinators at BPB, whose trust,
patience, and persistence kept me going. I profoundly thank my book
reviewers for doing an excellent job in a very short span of time. Overall, it
was a tremendous experience that cannot be explained in words.
Preface
This book covers Java persistence API – starting from its birth to the recent
advancements by including different kinds of databases that are non-
relational. The key focus is on the JPA concepts and their usage in different
JPA providers with a special focus on Hibernate and EclipseLink.
The book describes the basic concepts of a relational database that are
required to understand the JPA concepts as well. It demonstrates various
features of JPA with code snippets that include configuration using XML
(old style) as well as annotations (new style). It also provides a good
understanding of complex database concepts like locking, concurrency and
transactions.
The book takes a practical approach with more focus on JPA provider
implementations - it focuses on two widely used implementations namely,
Hibernate and EclipseLink. This book also provides sample mavenized
project which can be used as a starting step for any JPA-based project
creation. It also provides important JPA questions and their solutions which
helps the reader to be well prepared for any interview.
Chapter 1 will aim at introducing Java, and various strategies formed in
Java for persisting data followed by a detailed explanation of various terms
related to Object-relational model, mapping, and impedance mismatch and
finally concluding with a discussion on various types of technologies that
are/were used to solve the Java persistence problems.
Chapter 2 will concentrate on the most widely used persistence model
namely relational databases. All the basic concepts like tables, rows,
columns, cells, keys, types of data, conversions, and access types are
detailed out with specific mention on how these are used in JPA. Here the
main aim is to introduce the relational database design concepts and their
usage in JPA. It is noteworthy that configurations are given in both XML as
well as annotations as much as possible.
Chapter 3 will focus on operations on the relational database like
identifiers and how to use them as keys. It also discusses sequencing
strategies to generate identifiers, and other strategies to generate primary
keys. This chapter touches upon inheritance and locking techniques with a
special interest in various locking strategies like optimistic, pessimistic, etc.
Chapter 4 will discuss more on how the stored data are related to one
another. This also provides a detailed discussion on various relations found
in RDBMS and how they are defined in JPA as well as implemented in JPA
providers.
The storage of data becomes relevant only if it can be retrieved later on for
reference.
Chapter 5 will discuss more on how the stored data can be retrieved and
what all querying mechanisms are supported in JPA. This also discusses the
JPQL BNF which can be considered as a reference for those who want to
go in-depth and understand the JPQL building blocks. Note that this JPQL
BNF is optional and can be skipped if required. This will not cause any
break in the flow of the contents.
Chapter 6 will explain the Entity Manager and its role in JPA. Persisting,
caching and transaction management come under this section and is helpful
in understanding the important role that the Entity Manager has in any JPA
implementation. Various CRUD operations performed by RDBMS become
the Entity Manager’s responsibility.
Chapter 7 will describe the two most widely used JPA implementations –
Hibernate and EclipseLink. Both the implementations will be explained in
the same structure – history, features, architecture, and querying being the
main topics. A few special topics like cache architecture and poly glot
persistence will also be covered as part of this.
Appendix Part 1 will discuss advanced topics in JPA like events, views,
stored procedures, replication, multi-tenancy, auditing, NoSQL, etc. There
are many more topics that might raise interest in the reader to understand
more about the relational and non-relational world of data and their object
references.
Appendix Part 2 will provide a sample maven project with a JPA example
which can be considered as a starting project for JPA. The desired output is
also mentioned so that it can be verified by the reader. This also provides a
list of sample questions along with solutions or hints to the solution which
aims at making the reader aware of the type of questions to be expected
during an interview. Note that, for this reason, every chapter is provided
with a Q&A section and points to ponder which provides many interesting
facts.
Code Bundle and Coloured Images
Please follow the link to download the
Code Bundle and the Coloured Images of the book:

https://rebrand.ly/2mrczls
The code bundle for the book is also hosted on GitHub at
https://github.com/bpbpublications/Mastering-Java-Persistence-API-
JPA-. In case there's an update to the code, it will be updated on the
existing GitHub repository.
We have code bundles from our rich catalogue of books and videos
available at https://github.com/bpbpublications. Check them out!

Errata
We take immense pride in our work at BPB Publications and follow best
practices to ensure the accuracy of our content to provide with an indulging
reading experience to our subscribers. Our readers are our mirrors, and we
use their inputs to reflect and improve upon human errors, if any, that may
have occurred during the publishing processes involved. To let us maintain
the quality and help us reach out to any readers who might be having
difficulties due to any unforeseen errors, please write to us at :
errata@bpbonline.com
Your support, suggestions and feedbacks are highly appreciated by the BPB
Publications’ Family.

Did you know that BPB offers eBook versions of every book
published, with PDF and ePub files available? You can upgrade to
the eBook version at www.bpbonline.com and as a print book
customer, you are entitled to a discount on the eBook copy. Get in
touch with us at: business@bpbonline.com for more details.
At www.bpbonline.com, you can also read a collection of free
technical articles, sign up for a range of free newsletters, and receive
exclusive discounts and offers on BPB books and eBooks.
Other documents randomly have
different content
CHAP. XI.

LETTER LXVIII.
From Capt. Sinclair to Capt. Flint.
My Dear Sir, Jamaica.

Our worthy and zealous friend Mr. Paget having spared me the
painful detail of events, which, of late, have rendered this abode of
peace one of sorrow and consternation, I will employ my pen on
subjects of better and renewed hopes. In the first place, Lady
Maclairn will be soothed by hearing, that Philip is the father of a fine
healthy boy; and that the mother is doing well, and already the
nurse. She has been cautiously told of Mr. Flamall’s death; and thus
the suspense and alarm avoided, that would have been occasioned by
her seeing her husband’s dejection, which was but too apparent, in
spite of his endeavours. We must give him credit for more sensibility
on this melancholy occasion, than we feel ourselves. To say the truth,
the termination of a life passed without honour or satisfaction, is, in
my opinion, little entitled to the tear of affection; although the
means, which Flamall employed for the purpose, are appalling to
nature and to the Christian. It is a happy circumstance for my
brother, that he has uniformly conducted himself in respect to his
uncle, so as to have secured his own self acquittal. This, with the
prospect of happiness, before his eyes, will, in time, restore him. We
shall, however, wait with anxiety for news from Farefield. Had not
his wife’s critical situation checked his solicitude for his mother, I
believe we could not have prevented his undertaking the voyage to
England, for the purpose of supporting her, in the trial which nearly
overset himself.
I beg you to be particular in your account of Lady Maclairn’s
health, as also Miss Flint’s.
Let Miss Cowley be assured, that her concerns will suffer nothing
from the loss of her agent. We have been fortunate in having with us
a Mr. Montrose; this gentleman is the early friend of Philip and
Margaret; and is brother to Mrs. Lindsey, my sister’s first nurse, and
constant companion at present.
Montrose makes a better consoler than myself. I therefore yield up
to him this office; as being his by profession; and no man can better
know, and perform his duty. I have not, however, been idle. The
attested papers you will receive with this, will inform you that all has
been done that could be done. Flamall’s late gloom and the evidence
of the servants, induced the coroner’s inquest to give in a verdict of
lunacy. We have discovered no letters nor papers of consequence, to
his private concerns; and one letter excepted, of a recent date, from
his banker, which mentions his having received the half year’s
interest of five thousand pounds Bank stock: this of course devolves
to his sister. I cannot conclude this letter, without telling you, that I
believe, from the order in which all Flamall’s accounts were, that he
has, for sometime, been meditating how to escape from a world, in
which he knew he was regarded with contempt. You may think me
too harsh; be it so. But believe me sincere and honest, and

Your’s to command,
Francis Sinclair.
LETTER LXIX.
From Dr. Douglass to Mr. Hardcastle.
Farefield, Dec. 30.

I conjure you, my dear Sir, to rely on my assurances. Miss Cowley


is entirely out of danger. We have a decided intermission, and are
hourly gaining on the enemy. But I will not disguise my fears, for the
consequences which will probably result from you and Miss
Hardcastle’s visit here at this time. The truth is, that as terror and
exertions beyond Miss Cowley’s strength, produced the fever, it is my
opinion, that joy, and a new demand on her feelings, will produce a
return of it. Calmness and repose are necessary to give efficacy to the
medicines which have hitherto been useful, and I entreat of you, to
postpone your journey, till my patient is more able to welcome you.
To say what this young creature’s fortitude has been, is beyond my
abilities! I only know, that I shall in future blush, when I hear
strength of mind called a masculine endowment.
You will easily imagine, how little prepared she was, after the
attention and exertions she had shown to Lady Maclairn, to sustain
the sudden terror, which Miss Flint’s death produced. Every
precaution had been used to prevent the intelligence of Mr. Flamall’s
death, from reaching the dying woman. She was so weak, as to bear
with apathy her sister’s absence from the room; indeed, she noticed
little those who were about her, being for the most part in a lethargic
stupor, and gradually sinking. In the neighbourhood it was, however,
no secret that Mr. Flamall had died suddenly. Warner, Miss Flint’s
woman, had in the morning left her post to a chamber maid, in order
to get some repose. This girl’s mother had been frequently employed
in the sick room, and she, on calling to see her daughter, was
directed where to find her. Miss Flint was heavily dozing, and the
women, though with precaution, as they say, talked of poor Lady
Maclairn’s illness, and the melancholy news from Jamaica. The
visitor had heard the report, which has circulated here, and which a
London newspaper has communicated to the public. Namely, that,
“Mr. Flamall was assassinated by a negro, whom he had too severely
treated.” I suspect the precaution of whispering this tale was
forgotten, in the eagerness of curiosity and the love of the
marvellous. Suddenly, they were alarmed by a faint scream from the
sick woman, who, with convulsive groans and agitations, said, “dead!
murdered! lost! for ever lost! Flamall!” Screams followed this
apostrophe, and the terrified girl ran to Miss Cowley’s room. She was
unfortunately sleeping on the sopha, after having passed the greater
part of the night by Lady Maclairn´s bed side. She rose with
firmness, to perform the duty to which she was summoned; not
permitting Mrs. Allen to be informed of what was passing; because
she was with Lady Maclairn. I found her calm and collected; sitting
by the dying Miss Flint, whose senses were lost before she ceased to
breathe. Let me finish this melancholy detail, by saying, that I did
not quit Miss Cowley’s bed side for the space of six and thirty hours.
Heaven was merciful! and she will be restored to health. But we must
have no beloved friends to greet at present.
I quit you to obey the summons of my precious patient. She insists
upon signing this bulletin. She will soon be well; for she is growing
saucy, and this morning, at four o’clock, when I carried her the
prescribed potion, she told me “that in my night cap and gown, I was
the very image of Blue Beard; and still more savage than he; for, that
his scymitar was nothing in comparison with my glass of poison.”
Judge with what contentment of mind I now sign the name of your
sincere

Archibald Douglass.

P.S. Indeed, my dear Lucy, I am getting well. They tell me, the
wind is still against the Lisbon packet’s sailing. How fortunate I am!
There! the whole junto are rising! and the inkstand has vanished.
Your’s! your own R. Cowley is, indeed, only too weak to mutiny
against this authority.
LETTER LXX.
From Miss Cowley to Miss Hardcastle.
It is with gratitude to Heaven, that I find my dear friends at
Heathcot, are relieved from their too tender anxieties and
apprehensions on my account, yet wherefore do I say “too tender,” I
recall the words, my Lucy, which my heart does not sanction, and I
will not assume a virtue I have not; I give you joy, that death has
spared to you your Rachel Cowley. I rejoice in your love; and I
participate in your present feelings. Your goodness to Horace has
contributed towards my restoration. I should have died, had you
mentioned your terrors to him.
I have written to him the state of affairs here. He will be satisfied,
that the recent events, in which I have been engaged, occasioned the
brevity of my letter.
Mrs. Heartley sends her love to you with the enclosed: she insists,
that you will be better pleased with it, than with my labours. They
have, amongst them, annihilated the self will of your

Rachel Cowley.
LETTER LXXI.
From Mr. Serge to Mrs. Heartley.
(Enclosed in the preceding.)

Madam, Putney.

I make no doubt, but that you have heard Mr. Maclairn mention
his friend Jeremiah Serge; and that you are convinced, I mean to
deserve my title. I shall, therefore, enter into the business before us
at once. Herewith you will receive the deeds, which secure to your
daughter and her children the estate called the Wenland Farm, now
occupied by Malcolm Maclairn; the day she becomes that
gentleman’s wife, he is her tenant and his children’s steward.
Counsellor Steadman has managed this affair for me, to my entire
satisfaction, and I trust it will not be less so to my young friend.
I have, for the first time, during many long weeks, felt that the
Almighty has yet the means in his hands with which to heal my
wounds. I never, Mrs. Heartley, had a son; I have not, like Sir
Murdoch, had a son like his Malcolm, to follow me in my feeble
steps, with duty and affection; nor try to perpetuate my name, and
his own virtues to children unborn; but I had a child, who was, whilst
she lived, the joy and the prop of my life! But you know what I have
had to suffer! I am forgetting the object of this letter.
From the first hour I knew Mr. Malcolm Maclairn, I took a liking
to him; this goodwill was, in part, owing to the favourable character I
had of him from my excellent friend, Counsellor Steadman. Some
particulars I learned from this gentleman, led me to think that it was
in my power to serve this worthy young man; and with this intention,
and other thoughts in my mind, I paid my visit to Farefield Hall. I
was in part disappointed in my scheme; but I saw the young man was
all, and more, than I expected, and I gave him my heart, though I
could not give him my daughter’s hand. I thought I had explained
myself to his good father, in regard to my views in assisting the son;
but I perceived, that Sir Murdoch had a little of the infirmity, which
is common to men of high birth; so I consulted the counsellor, and
did what I could without offending the baronet’s high spirit.
Believing that you are a very judicious lady, I request from you the
favour, in case you should see the good baronet’s scruples, to say
what, in truth, you may affirm, that you perceive nothing in my
conduct, that ought either to offend, or surprise him.
Some men, with less wealth than I possess, keep fine houses, fine
madams, and fine horses; buy fine pictures, and plant fine gardens.
Now, Mrs. Heartley, I have no taste nor pleasure in these things;
seeing I was not brought up to like, or understand them; but this is
no reason why my money should be useless to me, and if I can
purchase, by my superfluity, the happiness of having such a friend as
Malcolm Maclairn, I should be a fool not to have done what I have
done. So, heartily wishing the young couple happy, and
recommending to your fair daughter to marry her tenant directly,

I remain, your sincere,


Jeremiah Serge.
LETTER LXXII.
From Miss Cowley to Miss Hardcastle.
January 12.

My patience is recompensed. “I may write half an hour, seeing that


scribbling is the aliment some girls live upon.” This is my kind
doctor, Lucy; and if you had seen how grateful I was for this
indulgence, you would be of Mrs. Heartley’s opinion, who has
pronounced my fever good for something; for that it has saved Lady
Maclairn’s life; and, as you may perceive, has taught me to submit.
Blessed be God for the renewal of that life, which is so dear to my
friends! and which I may, if it be not my fault, still render a blessing
to them and myself.
We are once more in sight of the harbour of peace; not indeed of
that peace which “this world can neither give nor take away,” but of
that season of tranquillity, which, in mercy, is allotted to man, in
order, as it should seem, to give us time to refit our feeble bark, and
to rectify the chart, to which we have hitherto trusted; to recover by
repose, strength and vigour for the storms and perils we may yet
have to encounter in our passage to eternity; and to leave behind us
traces of that providential power which hath piloted us home.
You will like to have the particulars of Miss Flint’s will. It will
satisfy you, as it has done me, that a death-bed repentance is much
better than none. She specifies, that, in consideration of her brother
Oliver’s donation to Philip Flint, it appears to be an incumbent duty
on her part, to provide for those of her family, who have been too
long neglected, and to the last moment of her mortal life, will she
bless Philip Flint, for having seconded her in this act of justice, by his
advice and concurrence.
The Farefield estate, with the moveables, besides a considerable
sum in money, which will devolve on him as residuary legatee, are
left to Captain Flint for his life; at his decease they go to Philip Flint,
to whom she has only bequeathed five thousand pounds “as a token
of her love.” To her niece Mary the same sum, payable when she is of
age, and five more at her uncle’s decease. To Malcolm Maclairn two
thousand pounds, “as a mark of her esteem for him, and gratitude to
his mother.” By the way, poor Malcolm was nearly overpowered by
this mark, for he had not mourned as one who needed comfort; and I
suspect that his conscience was not quite prepared for the legacy.
To the poor of the parish she has left a liberal peace offering: to her
servants she has been generous and just: to Warner, her woman, she
leaves a thousand pounds.
Flamall’s execrable name does not appear in any paper that is left;
and yet the contents of the cabinet left to Lady Maclairn’s inspection,
clearly prove that Miss Flint had long been engaged by the thoughts
of death. Not a friend has been overlooked but Flamall, and it is
evident to me, that she ceased to regard him even in that point of
view, from the time he declared his marriage. I suspect she was
informed of his baseness in that business. All her little donations
were marked and ticketed by her own hand. To Sir Murdoch she
leaves a very fine seal; its antiquity as well as beauty, make it
valuable. To Mrs. Allen a gold snuff box, containing an hundred
pound bank note, “for mourning;” for Miss Cowley a diamond ring.
To each of Douglass’s boys a hundred guineas for books, and three
hundred pounds in notes, for their worthy father. A small box,
directed “to my niece, Mary Howard, as a token of my too late
repentance and unfeigned love.” The captain, who was present when
her ladyship performed this painful office, was so much affected by
the sight of this box, that he burst into tears, and, with extreme
agitation, tore off the address, and put it in his bosom. Philip Flint
had not been overlooked in this partition of kindness. Her picture in
miniature, taken at the time he was born, with a rich string of pearls
that had been her mother’s, were marked for him and his wife. We
have since examined Mary’s gift. Some fine lace, and a few family
jewels are the principal things. When you have cautiously informed
her, that, from her aunt’s hand, she has restored to her what she will
judge to be invaluable, namely, her father’s and mother’s pictures, so
long lost! so deeply regretted! But I am called to order; and you will
be contented with this four day’s labour of your poor shackled Rachel
Cowley; who is bound, though in silken fetters. You know that the
Heartleys are here. I gain nothing by that; for they are as bad as any
of my arguseyed nurses.
P. S. My dear Miss Hardcastle, we have now only to fear that our
patient should be too soon well. She has no fever, but that which
arises from her exertions. She cannot vegetate, to use her own word;
and she thinks her body is strong, because her mind is never idle. It
is in vain that we oppose her. She will write; and then who can
wonder that she does not sleep! Use your influence, and give us time
to recruit her strength.

Yours,
A. Heartley.

Mrs. Allen is in good spirits. She has left me nothing to say in


regard to Doctor Douglass. But, I verily believe, his care saved the life
of our precious friend. She was, indeed, for some hours, so ill as to
leave little for hope. I leave Alice to express, to my dear Mary, all that
my full heart feels on her account.
CHAP. XII.

LETTER LXXIII.
From Miss Cowley to Miss Hardcastle.
January 29.

Although in the calculation of months and weeks, I have contrived to


beguile the lagging hours which are still between me and my
promised bliss, I have not yet been able to find an expedient for the
day, without scribbling to you. It seems to be the aliment necessary
for my existence; and notwithstanding I could match an hungry
school boy, in my appetite for my pudding, I could sooner console
myself for the absence of my dinner, than of the use of my right
hand, as the agent of my fondest, sweetest employment. I have
written a volume to Horace; and he will know as much of the
occurrences at Farefield, as will content him. He will know that I am
in health and in hope. Say not a word of my having been so ill. The
old bard says, “men are deceivers ever.” A woman therefore, may for
once deceive, when in that deceit, she spares to a beloved object the
useless anxiety arising from past danger and past pains.
Yesterday our “busy-heads” went to Wenland place, in order to
give their opinion of certain alterations and improvements projected
by the new tenant Malcolm. I was ordered to stay at home by my
despotical doctor, and Lady Maclairn promised to take good care of
me.
They departed after breakfast, meaning to dine at Mr. Wilson’s,
and left us to a danger, as bad as cold rooms. I soon found it
impossible to evade the topic I so much dreaded for her; she at once
led to the subject by saying, that she had still secrets to communicate
to her only comforter, but that she feared my sensibility. I desired
her to proceed. “Some time before my sister’s death,” continued she,
“I received this sealed parcel from her hands. It is, as you see,
addressed to myself. I hesitated when she offered it to my
acceptance. She observed my reluctance.” “Make yourself perfectly
easy,” said Miss Flint, “it contains nothing but papers essentially
necessary for your future security. I cannot die, without telling you
that they are necessary. You do not know your brother, Harriet, so
well as I do; and I must tell you, what steps I have taken to secure
you from his future tyranical power. I shall die, however, without
bitterness of spirit. I once loved Flamall; I do not accuse him here;
nor will I accuse him hereafter; for my own envy, my own implacable
spirit, my own stubborn and hard heart prepared the way for the
influence of his inordinate purposes, and more deliberate mischiefs.
As a father, he has been equally base and cruel. Philip has informed
me of the measures he pursued, in order to gratify his ambition in
regard to his son’s marriage with Miss Cowley. Let it suffice, that
they were such as did not surprise me. I immediately wrote to Mr.
Flamall. You will find a copy of my letter amongst those papers. He
knows, that I have, by a full and ample confession of my crimes, so
implicated them with those which he has committed, as must ruin
him in this world, if discovered; and as inevitably destroy his hopes
of a better, if he do not repent. Should he ever dare to disturb the
comforts of my son, by a declaration of his real affinity to him;
should he ever dare farther to invade on your peace; he knows what
must be the consequence. Actions, which will be recognisable in a
court of justice, will determine his fate, and crush with ignominy his
worthy and unoffending child. Obdurate as he is in sin, nature is not
extinguished in his bosom. He loves his son, and, I am certain, would
sooner die himself, than see him disgraced in the world: time may
soften to him his present disappointment. I have urged to Philip
every possible measure, in order to effect a reconciliation between
him and his uncle Flamall. He may, if he be wise, live on good terms
with his son, and if he be not lost to conscience, he may find
employment, for his remaining term of grace.” “You weep, my dear
Harriet,” continued my poor Lucretia; I cannot. How many bitter
tears of yours will swell my account; for I was born for your sorrow!
and the ruin of the innocent! Can you give comfort to the broken and
contrite of heart? Can you say you forgive me? “As freely,” answered
I eagerly, “as I hope for mercy and pardon. I have also sinned, I have
also erred.” “Yes,” replied she, with quickness; “but the snare was
laid for you; and you only stumbled. I boldly invited the danger, and
made an acquaintance with guilt and perfidy; see to what purpose?
to languish with a mother’s yearnings, to behold and bless that child,
who would shrink from me as a monster, did he know me; to dread
the future, and to mourn, too late, the wretchedness annexed to a life
of guilt. Promise me,” added she, “to be still my Philip’s mother. Let
me die in the hope, that, you will never forego the title.” “Never,”
answered I, sensible only to her condition, “never, whilst it depends
on me to preserve it; he is mine in affection, and nothing can cancel
his rights to my love.” “May Heaven reward you,” exclaimed she, in
an agony. “May that child’s children bless and revere you——My poor
boy will not be surprised at the tenor of my last will,” continued she
thoughtfully. “He is rich; and I have explained my intentions, in
regard to my brother and Mary. It required very few arguments to
prove, that they had not been justly treated. But let me not think of
their wrongs! I wrote him word, that it was essentially necessary to
my peace to consider them. His last letter was a cordial to my sinking
soul; he urges me even to omit his name, if it interfered with my kind
purposes; that he possessed more than he wanted of the goods of
fortune. Judge, adds he, when I tell you that my brother has
frequently realized fourteen thousand pounds annually from his
estates: Judge whether, my dear, I may say maternal friend and
sister, needs bequeath me more than her blessing and her love.” “I
wear at my heart this precious letter,” added she, taking it from her
bosom; “but you must take it with the papers. His picture may yet
remain, I mean it should moulder into dust with me.”—She paused
—“I think,” pursued she, as though collecting herself, “that I may
hope to stand acquitted before my Maker for the last and only
compensation I can make to some, whom I have injured; perhaps
strict justice would exact more sacrifices. But I am a mother,
Harriet; the guilty mother, of an innocent child, now a worthy
member of society. Something is surely due to him; and thy merciful
Maker will not weigh this consideration in the balance of offended
justice. Such has been my state of mind for some time past, that had
it not been for Philip, I would have fearlessly met every stigma with
which this world could have branded me, for the hopes of meeting
with a reconciled God. It becomes not me to say, that I think, in this
instance of my conduct, I have acted right. But conscience has at
least been my guide; I have done for the best. Will not that prudence,
which will protect the honour of your family, and the happiness of
mine, sanction your secresy in regard to the birth of thy poor——!”
She could not go on. Again I soothed her to composure, I solemnly
repeated my promise, my dear Miss Cowley, that I would preserve
our secret from every danger of a disclosure. “This engagement now
distresses me,” continued Lady Maclairn, “I fear I have been wrong;
but what could I do, in a moment of such difficulty? I was unequal to
the trial; I could not see her die miserable.”—
I placed before Lady Maclairn the wonderful interference of
Providence, which had removed the guilty, to secure the innocent. I
urged to her the purity of her intentions, and the humanity which
pointed out to her the line of conduct she had pursued, and had
engaged to pursue. “Repose on your merciful Maker,” added I, “for
an acquittal, where you mean to do for the best; patiently wait the
end, when this darkness shall be removed; and you will, I trust, find,
that having lived to promote the happiness of others, to have
contributed to the comfort and security of your family has not been
to live in vain. Be assured, my dear friend, that your sufferings will
have their place with a Being “who knoweth what is in man; and with
a Father, who loveth his children, you may reasonably hope for
acceptance and favour.”” “You are my comforter,” replied she,
meekly raising her eyes to Heaven; “I have not outlived this first of
all human hopes. My weakness, not my will, has betrayed me from
the paths of rectitude. But it is difficult for me, to conceal my
feelings. I dare not even break the seal, which confines my
knowledge to what I already know of the wretched life and conduct of
my brother; I sometimes think I shall lose my senses, in reflecting on
his end, and the enormities of his conduct. Oh, it is dreadful, Miss
Cowley, to follow him to that tribunal before which he must appear!
——Leave me for a while,” added she, sobbing, “leave me to my God,
to my Almighty supporter”——I obeyed, too much affected to resist. I
took the papers with me. She has acted prudently in not reading
them. She begs they may be forwarded to you, and that the whole
transaction may remain in your hands. You are allowed to read them.
What will you say to the letter marked No. 4? The one she burned
was the answer to it; but I dare not pursue this horrid subject. My
eyes would betray me, and the doctor would be angry; for he has
made me promise not to harrass my spirits, and to check my friend’s
sorrows. I am going to her! and we will be wise. The return of the
vagrants renders this necessary.

Yours,
Rachel Cowley.

P. S. Sedley will give you this.


LETTER LXXIV.
From Miss Cowley to Miss Hardcastle.
Again I am permitted to take a better cordial than bark. Mrs.
Heartley has fully explained to us the mystery relative to the portraits
in Miss Flint’s possession. It appears that Mrs. Howard,
apprehending that they would be more pernicious to her brother,
than consolatory, requested Mrs. Heartley to secrete them from his
search. She obeyed her dying friend. “But,” added Mrs. Heartley, “my
feelings at this juncture were nearly as little under the control of my
reason, as poor Percival’s. I wrote a letter to Miss Flint, which was
dictated by my sorrow, and the romantic hope of touching her heart
in favour of a child whom she had contributed to render an orphan
and a beggar. I enclosed these powerful pleaders,” continued Mrs.
Heartley, taking up the miniatures, and surveying them with
emotion, “and my language was not less forcible. Malcolm was
employed to place my packet in her hands. He effected his purpose;
for she found it on her dressing table. The next morning he was
questioned, and he frankly owned, that he had, at my request, placed
the parcel where she had found it. You have been faithful, Sir, in the
performance of your commission, said Miss Flint, trembling and pale
with fury; “be so in delivering my message to your Mrs. Heartley.
Tell her, that her insolent and officious interference has failed, and
that whilst Miss Flint’s family have no better advocates than a kept
mistress, she wants no apology for renouncing it.” Malcolm bluntly
told her, that she must employ some one to deliver such a message
who had never heard of Mrs. Heartley; for himself, he begged leave
to decline insulting his best friend. I heard no more from Miss Flint;
and I concluded that she had destroyed the portraits in a similar
manner as she had that of her mother. Frustrated in my project, I
was forced to conceal this occurrence; and the pictures were
supposed to be irrecoverably and unaccountably lost.”
Although my conscience reproached me frequently when hearing
the captain bewail this loss, it never did so as to the motive from
which I had acted: but it is to be feared, that my zeal in the cause of
the injured, disqualified me for making a convert to justice and
humanity. It is most probable that I irritated where I wished to heal;
and it is certain, that I was from that time the object of Miss Flint’s
implacable resentment. “Poor woman!” continued Mrs. Heartley,
with compassion, “she was then under the miserable yoke of those
passions, which although they govern, cannot blind us. Neither her
spirit of resentment, nor any entrenchment from her prosperous
fortune, could shield her from the voice within her bosom. It spoke
my language with tenfold energy, and she hated me, because she
knew I was in unison with her conscience. She shunned me, as she
would have shunned that, had she been able.” “Is it not
unaccountable,” added Mrs. Heartley, addressing me, “that any
rational being should fear to encounter the eyes of a fellow creature
under the circumstances of guilt, nay, even of folly, without
considering the power of conscience, from whose suggestions this
very dread arises. That Miss Flint was sensible of its power is certain.
Nor do I believe, with some, that it is possible for us to outlive its
authority. When I hear of such, who are said to be hardened by sin,
and become callous by guilt, I no more believe it, than I do those
tales I hear of the elixir for perpetuating our existence here for ever. I
am convinced that God will not be mocked by the creatures of his
power, and I have only to follow the bold and impious offender of his
laws to his hours of privacy, to learn, that he cannot evade that
Being’s presence, whose commands he insults.” I was more disposed
to shorten this conversation, than to dispute the truths it contained.
Lady Maclairn’s conscience wants no stimulants. Douglass entered,
and we became cheerful. You love the doctor, you say, prithee who
does not? but no one shall love him so well as Horace. You have
heard of his gallantry three or four nights he past in my antichamber!

Rachel Cowley.
LETTER LXXV.
From Miss Cowley to Miss Hardcastle.
I am, my dear friend, so powerfully impressed by the perusal of
Miss Flint’s confession, as her legacy to Lady Maclairn may with
truth be called, that I cannot divert my mind from the subject. What
a scene of iniquity have I sent you! and how rejoiced am I, that I
prevailed on Lady Maclairn not to tear open those wounds afresh by
reading a detailed account of actions and artifices which her brother
employed to defraud Mr. Flint’s children of their rights. Surely, my
Lucy, the death of Flamall was “a consummation devoutly to be
wished.” To be removed from the indignation of the injured, to be
spared from the abhorrence of the virtuous; to be saved from the
constant dread of living an object amenable to the most vigorous
laws of his country; to be freed from the horrors of his dying bed! But
how momentary is this delusion of feeling! My reason and my faith
point out this disembodied spirit in its next state of existence. With
trembling awe I follow it to the tribunal of an all-wise, omnipotent,
and pure Judge. There do I contemplate this forlorn and sullied soul,
as rushing uncalled into the presence of that Being, whose merciful
purposes he has counteracted; and whose laws he has insulted.
Nature stands appalled, at the magnitude of offences like these; and
humanity must deplore the sinner thus cut off in the midst of his
sins.
I cannot however help being of opinion that, useful as the
contemplation of a Flamall’s life may be to beings who fearlessly
follow the impulse of every disorderly passion, we, my beloved Lucy,
shall not be unwise, to direct our thoughts from such shocking
depravity of creatures like ourselves. I wish so to do; and yet not lose
the lesson of wisdom as applicable to myself. In what, I would ask
you, consisted the difference between Miss Flint and Rachel Cowley
at two years of age. The general lineaments of our minds have a near
affinity. What has produced the moral differences which from that
period have discriminated us? Education, and the habits resulting
from our respective situations: in the one instance, the soil was left
uncultured; in the other, it was judiciously cultivated. Lucretia had
been overlooked by her mother in the early period of her life.
Indolence and indulgence were this mother’s faults. She found, in
cultivating the docile and mild Percival, a gratification of her own
taste, and an object of amusement, as well as for exclusive
tenderness. This mother wanted firmness, and the vigilance
necessary for her duty. When passion had taken its root, this
unhappy creature was consigned over to the care and tuition of a
schoolmistress. I mean not to be illiberal; for I believe many women
in that class of life are not only accomplished women, but
conscientiously disposed to be useful to their pupils; but I cannot
think that in a large school, either the temper, or peculiar moral
defects of a girl are likely to meet with that nice and accurate
observation which are necessary for their correction. I will however
admit that in this seminary Miss Flint acquired the outward habits of
decorum, and that knowledge, which, with experience, and a
different temper, might have conducted her, as it does multitudes of
our sex, in the common routine of private and domestic life. She then
returned to her parents, slenderly furnished by the gifts of nature,
with a spirit unsubdued, and a mind without any fixed principle of
action, beyond a confidence in herself. She was next a candidate for
favour in the world; and she proudly conceived that no one would
dare refuse it; but she found a rival, even in the cradle, and under the
parental roof. Is it to be expected, that from such a disposition, and
under such circumstances, envy and malice could be long a stranger
to her? The mother perceived their baneful influence; and she
opposed to their growth, nothing but remedies which relieved herself
from trouble and vexation. She flattered instead of reproving, and
gave to her daughter an authority which she knew she would abuse.
Uncontrouled and domineering over those about her; irritated by the
neglect of those whom she could not subjugate to her imperious will,
she became soured, disappointed, and vindictive; and she finished by
becoming the fit instrument in the hands of a Flamall, for the ruin of
the innocent, and the perpetration of injustice, cruelty, and deceit.
Thus have we seen the fatal torrent of unchecked passions flow!
but suppose this wretched victim of their fury had been in Mrs.
Hardcastle’s hands. Oh Lucy, we want no supposition! We have seen
a torrent, not less impetuous, directed by her wisdom, to the salutary
purposes for which Heaven gave it strength and abundance; and
instead of desolating all within its reach, it has been led to supply
delight, and satisfaction! How often has her patient firmness
subdued my angry passions? How often has she detected them
before I knew their power! With what skill did she temper and mix
the warm affections of my nature with the rougher elements which
composed me. How sweet, how endearing was her notice of every
little triumph I gained over myself; and with what discrimination did
she effect that bond of love, which made her children useful to each
other. Her Lucy’s gentleness was opposed to her Rachel’s courage;
and Horace’s self-command was the only point to which emulation
was recommended. Is it wonderful, that I have escaped the fate of a
Miss Flint? Is it wonderful that I should love virtue, and reverence a
faith thus exemplified? No, Lucy. But I have to fear, lest I should
disgrace Mrs. Hardcastle. We may, and I hope we shall, live to be
wives and mothers. Let us in that case, aim at being something better
than mere teeming animals; and like some in that class, who,
following their instinct, squeeze their offspring to death through
fondness. I am persuaded that we are weak and fallible creatures; but
I cannot for an instant admit, that an all-wise and merciful Being has
exacted any one duty, or enforced any one command, without having
bestowed upon us the faculties and capacity for fulfilling our
obligations. Every mother whose mind is sound, is called upon to
perform the duties of a mother; and without any better guide than
her own reason and attention, she will soon perceive that something
more is required, than merely watching over the preservation of her
children. I am, and I wish to remain, a stranger to that humility
which represses, as beyond me, all that is arduous and praise-
worthy. I believe, that by applying my heart to wisdom, I may
become wise; and the mother who diligently watches over the first
openings of moral existence in the beings entrusted to her, will soon
discover, that she has the necessary talents for governing them
safely. Attention and experience will enlighten her; and should she
never reach to the accomplishment of all she wishes, she will at least
secure to herself the favour of God, and her own peace of mind. It
pleases me, my Lucy, to look forward to that period, when, with the
name of Hardcastle, I may be treading in the same path of duty
which our mother pursued in her road to Heaven. Will you wish me
to suppress my hopes, that I may one day be able, with the pure joy
of an accepted spirit in her abode of bliss, to point to her those
inmates, whom her virtues trained for happiness? Yet why this tear?
I cannot erase the blot it has made. Wherefore is it that my spirit
faints? You must come and chide me; you will find me paler and

You might also like