100% found this document useful (8 votes)
64 views

Programming Google App Engine Second Edition Dan Sanderson all chapter instant download

Engine

Uploaded by

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

Programming Google App Engine Second Edition Dan Sanderson all chapter instant download

Engine

Uploaded by

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

Download the full version of the ebook at ebookname.

com

Programming Google App Engine Second Edition Dan


Sanderson

https://ebookname.com/product/programming-google-app-engine-
second-edition-dan-sanderson/

OR CLICK BUTTON

DOWNLOAD EBOOK

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Essential App Engine Building High Performance Java Apps


with Google App Engine 1st Edition Adriaan De Jonge

https://ebookname.com/product/essential-app-engine-building-high-
performance-java-apps-with-google-app-engine-1st-edition-adriaan-de-
jonge/
ebookname.com

Google pedia The Ultimate Google Resource Second Edition


Safari

https://ebookname.com/product/google-pedia-the-ultimate-google-
resource-second-edition-safari/

ebookname.com

AI Game Engine Programming 2nd Edition Brian Schwab

https://ebookname.com/product/ai-game-engine-programming-2nd-edition-
brian-schwab/

ebookname.com

Trauma and Visuality in Modernity 1st Edition Lisa


Saltzman (Editor)

https://ebookname.com/product/trauma-and-visuality-in-modernity-1st-
edition-lisa-saltzman-editor/

ebookname.com
Forbidden Words Taboo and the Censoring of Language 4th
printing Edition Keith Allan

https://ebookname.com/product/forbidden-words-taboo-and-the-censoring-
of-language-4th-printing-edition-keith-allan/

ebookname.com

The Handbook of High Performance Virtual Teams A Toolkit


for Collaborating Across Boundaries 1st Edition Jill
Nemiro
https://ebookname.com/product/the-handbook-of-high-performance-
virtual-teams-a-toolkit-for-collaborating-across-boundaries-1st-
edition-jill-nemiro/
ebookname.com

Crash Course Anatomy 4E 4th Edition Louise Stenhouse

https://ebookname.com/product/crash-course-anatomy-4e-4th-edition-
louise-stenhouse/

ebookname.com

Mastering Corneal Collagen Cross Linking Techniques 1st


Edition Ashok Garg

https://ebookname.com/product/mastering-corneal-collagen-cross-
linking-techniques-1st-edition-ashok-garg/

ebookname.com

Moomins Cookbook An Introduction to Finnish Cuisine Sami


Malila

https://ebookname.com/product/moomins-cookbook-an-introduction-to-
finnish-cuisine-sami-malila/

ebookname.com
Must a violence 1st Edition Buchanan

https://ebookname.com/product/must-a-violence-1st-edition-buchanan/

ebookname.com
SECOND EDITION

Programming Google App Engine

Dan Sanderson

Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo


Programming Google App Engine, Second Edition
by Dan Sanderson

Copyright © 2013 Dan Sanderson. All rights reserved.


Printed in the United States of America.

Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.

O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (http://my.safaribooksonline.com). For more information, contact our
corporate/institutional sales department: 800-998-9938 or [email protected].

Editors: Mike Loukides and Meghan Blanchette Indexer: Aaron Hazelton, BIM
Production Editor: Rachel Steely Cover Designer: Karen Montgomery
Copyeditor: Nancy Reinhardt Interior Designer: David Futato
Proofreader: Kiel Van Horn Illustrator: Rebecca Demarest

October 2012: Second Edition.

Revision History for the Second Edition:


2012-10-04 First release
See http://oreilly.com/catalog/errata.csp?isbn=9781449398262 for release details.

Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc. Programming Google App Engine, the image of a waterbuck, and related trade dress
are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a
trademark claim, the designations have been printed in caps or initial caps.

While every precaution has been taken in the preparation of this book, the publisher and authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information con-
tained herein.

ISBN: 978-1-449-39826-2

[LSI]

1349379394
For Lisa, Sophia, and Maxwell
Table of Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv

1. Introducing Google App Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


The Runtime Environment 1
The Static File Servers 4
The Datastore 5
Entities and Properties 5
Queries and Indexes 6
Transactions 7
The Services 8
Namespaces 10
Google Accounts, OpenID, and OAuth 10
Task Queues and Cron Jobs 11
Developer Tools 12
The Administration Console 13
Things App Engine Doesn’t Do...Yet 14
Getting Started 15

2. Creating an Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Setting Up the SDK 17
Installing the Python SDK 18
Installing the Java SDK 22
Developing the Application 27
The User Preferences Pattern 27
Developing a Python App 29
Developing a Java App 44
The Development Console 61
Registering the Application 63
The Application ID and Title 64
Setting Up a Domain Name 65
Google Apps and Authentication 67

v
Uploading the Application 68
Using Two-Step Verification 69
Introducing the Administration Console 70

3. Configuring an Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
The App Engine Architecture 74
Configuring a Python App 76
Runtime Versions 77
Configuring a Java App 77
Domain Names 79
App IDs and Versions 81
App IDs and Versions in Python 82
App IDs and Versions in Java 82
Multithreading 82
Request Handlers 83
Request Handlers in Python 83
Request Handlers in Java 85
Static Files and Resource Files 86
Static Files in Python 87
Static Files in Java 90
Secure Connections 92
Secure Connections in Python 93
Secure Connections in Java 94
Authorization with Google Accounts 95
Authorization in Python 96
Authorization in Java 96
Environment Variables 97
Inbound Services 97
Custom Error Responses 98
Administration Console Custom Pages 99
More Python Features 100
Python Libraries 100
Built-in Handlers 102
Includes 103
Java Servlet Sessions 104

4. Request Handlers and Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107


The Runtime Environment 108
The Sandbox 109
Quotas and Limits 109
The Python Runtime Environment 114
The Java Runtime Environment 116
The Request Handler Abstraction 117

vi | Table of Contents
Introducing Instances 118
Request Scheduling and Pending Latency 122
Warm-up Requests 123
Resident Instances 124
The Instances Console 125
Instance Hours and Billing 126
Instance Classes 127

5. Datastore Entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129


Entities, Keys, and Properties 130
Introducing the Python Datastore API 131
Introducing the Java Datastore API 134
Property Values 137
Strings, Text, and Blobs 138
Unset Versus the Null Value 139
Multivalued Properties 140
Keys and Key Objects 141
Using Entities 143
Getting Entities Using Keys 143
Inspecting Entity Objects 144
Saving Entities 145
Deleting Entities 146
Allocating System IDs 146
The Development Server and the Datastore 148

6. Datastore Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151


Queries and Kinds 152
Query Results and Keys 152
GQL 153
The Python Query API 156
The Query Class 156
GQL in Python 158
Retrieving Results 159
Keys-Only Queries 161
The Java Query API 162
Building the Query 163
Fetching Results with PreparedQuery 164
Keys-Only Queries in Java 166
Introducing Indexes 166
Automatic Indexes and Simple Queries 168
All Entities of a Kind 169
One Equality Filter 169
Greater-Than and Less-Than Filters 170

Table of Contents | vii


One Sort Order 171
Queries on Keys 173
Kindless Queries 174
Custom Indexes and Complex Queries 175
Multiple Sort Orders 175
Filters on Multiple Properties 176
Multiple Equality Filters 179
Not-Equal and IN Filters 181
Unset and Nonindexed Properties 182
Sort Orders and Value Types 183
Queries and Multivalued Properties 185
A Simple Example 185
MVPs in Python 186
MVPs in Java 187
MVPs and Equality Filters 187
MVPs and Inequality Filters 189
MVPs and Sort Orders 190
Exploding Indexes 191
Query Cursors 192
Cursors in Python 195
Cursors in Java 196
Projection Queries 197
Projection Queries in Python 199
Projection Queries in Java 199
Configuring Indexes 200
Index Configuration for Python 201
Index Configuration for Java 201

7. Datastore Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203


Entities and Entity Groups 205
Keys, Paths, and Ancestors 206
Ancestor Queries 208
What Can Happen in a Transaction 210
Transactional Reads 210
Eventually Consistent Reads 211
Transactions in Python 212
Transactions in Java 214
How Entities Are Updated 219
How Entities Are Read 222
Batch Updates 222
How Indexes Are Updated 223
Cross-Group Transactions 224

viii | Table of Contents


8. Datastore Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Inspecting the Datastore 227
Managing Indexes 230
The Datastore Admin Panel 232
Accessing Metadata from the App 234
Querying Statistics 234
Querying Metadata 235
Index Status and Queries 236
Entity Group Versions 238
Remote Controls 239
Setting Up the Remote API for Python 240
Setting Up the Remote API for Java 240
Using the Remote Shell Tool 241
Using the Remote API from a Script 242

9. Data Modeling with Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245


Models and Properties 246
Property Declarations 247
Property Value Types 248
Property Validation 249
Nonindexed Properties 251
Automatic Values 251
List Properties 253
Models and Schema Migration 254
Modeling Relationships 254
One-to-Many Relationships 257
One-to-One Relationships 257
Many-to-Many Relationships 258
Model Inheritance 260
Queries and PolyModels 261
Creating Your Own Property Classes 262
Validating Property Values 263
Marshaling Value Types 264
Customizing Default Values 266
Accepting Arguments 267

10. The Java Persistence API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269


Setting Up JPA 270
Entities and Keys 271
Entity Properties 274
Embedded Objects 275
Saving, Fetching, and Deleting Objects 276
Transactions in JPA 278

Table of Contents | ix
Queries and JPQL 279
Relationships 282
For More Information 287

11. The Memory Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289


Calling Memcache from Python 290
Calling Memcache from Java 291
Keys and Values 292
Setting Values 293
Setting Values that Expire 293
Adding and Replacing Values 294
Getting Values 295
Deleting Values 295
Locking a Deleted Key 295
Atomic Increment and Decrement 296
Compare and Set 297
Batching Calls to Memcache 299
Memcache Batch Calls in Python 299
Memcache Batch Calls in Java 301
Memcache and the Datastore 302
Handling Memcache Errors 303
Memcache Administration 303
Cache Statistics 305
Flushing the Memcache 305

12. Large Data and the Blobstore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307


Accepting User Uploads 308
Web Forms and MIME Multipart Data 310
Blobstore Upload Requests 312
Handling Uploads in Python 313
Handling Uploads in Java 315
Using BlobInfo Entities 316
Using BlobInfo Entities in Python 317
Using BlobInfo Entities in Java 319
Serving Blobstore Values 320
Serving Blobstore Values in Python 321
Serving Blobstore Values in Java 322
Deleting Blobstore Values 323
Reading Blobstore Values 324
Fetching Byte Ranges 324
Reading Values with Streams 325
A Complete Example 327
A Blobstore Example in Python 328

x | Table of Contents
A Blobstore Example in Java 332

13. Fetching URLs and Web Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339


Fetching URLs in Python 341
Fetching URLs in Java 342
Outgoing HTTP Requests 344
The URL 344
The HTTP Method and Payload 345
Request Headers 346
HTTP Over SSL (HTTPS) 346
Request and Response Sizes 347
Request Deadlines 348
Handling Redirects 348
Response Objects 349

14. Sending and Receiving Email Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351


Sending Email Messages 352
Sending Email from the Development Server 353
Sender Addresses 354
Recipients 356
Attachments 356
Sending Email in Python 357
Sending Email in Java 360
Receiving Email Messages 362
Receiving Email in Python 363
Receiving Email in Java 365

15. Sending and Receiving Instant Messages with XMPP . . . . . . . . . . . . . . . . . . . . . . . . 367


Inviting a User to Chat 369
Sending Invitations in Python 369
Sending Invitations in Java 369
Sending Chat Messages 370
Sending Chat Messages in Python 371
Sending Chat Messages in Java 371
Receiving Chat Messages 373
Receiving Chat Messages in Python 374
Receiving Chat Messages in Java 376
Handling Error Messages 377
Managing Presence 378
Managing Subscriptions 379
Managing Presence Updates 382
Probing for Presence 386
Checking a Google Talk User’s Status 388

Table of Contents | xi
16. Task Queues and Scheduled Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Configuring Task Queues 393
Enqueuing a Task 395
Enqueuing a Task in Python 395
Enqueuing a Task in Java 397
Task Parameters 398
Payloads 398
Task Names 399
Countdowns and ETAs 401
Push Queues 402
Task Requests 402
Processing Rates and Token Buckets 404
Retrying Push Tasks 405
Pull Queues 407
Enqueuing Tasks to Pull Queues 409
Leasing and Deleting Tasks 409
Retrying Pull Queue Tasks 410
Transactional Task Enqueueing 411
Transactional Tasks in Python 413
Transactional Tasks in Java 414
Task Chaining 415
Task Queue Administration 420
Deferring Work 420
Deferring Work in Python 421
Deferring Work in Java 422
Scheduled Tasks 423
Configuring Scheduled Tasks 425
Specifying Schedules 426

17. Optimizing Service Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429


Calling Services Asynchronously 430
Asynchronous Calls in Python 432
Asynchronous Calls in Java 440
Visualizing Calls with AppStats 442
Installing AppStats for Python 444
Installing AppStats for Java 446
Using the AppStats Console 447

18. The Django Web Application Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451


Using the Bundled Django Library 453
Creating a Django Project 454
Hooking It Up to App Engine 455
Creating a Django App 457

xii | Table of Contents


Using Django Templates 458
Using Django Forms 460
The django-nonrel Project 465

19. Managing Request Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467


Writing to the Log 468
Logging in Python 468
Logging in Java 469
Viewing Recent Logs 471
Downloading Logs 473
Logs Retention 474
Querying Logs from the App 474
Querying Logs in Python 475
Querying Logs in Java 476
Flushing the Log Buffer 478

20. Deploying and Managing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481


Uploading an Application 482
Using Versions 483
Managing Service Configuration 485
Application Settings 485
Managing Developers 486
Quotas and Billing 487
Getting Help 488

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491

Table of Contents | xiii


Exploring the Variety of Random
Documents with Different Content
with their customs and beliefs the Dorians expressly intended to
limit the increase in population through the encouragement of boy
love and the separation of women from society.[48] But that in itself
would not explain the high regard in which homosexuality was held
in ancient Greece.
I refer those interested in the subject to the interesting work of a
philologist, Prof. E. Bethe.[49]
Like many other philosophers and investigators of history, Bethe
falls into the error of pointing to the Christian church as the agent
responsible for the newer orientation in sexual matters. In the first
place these writers overlook the fact that the new attitude had set in
already with Judaism. Secondly, they fail to see that religions are,
themselves, but the result of social conditions. Religious teachings
always adjust themselves to the social needs of their day and even
fulfill them. Religious formulæ prove meaningless only to the
progressive, emancipated, free and forward-striving persons, the
imperatives of religion are superfluous only for those above the
average. The crowds must cling to religious formulæ and will always
need sexual inhibitions of a religious character.
Sexuality is changing all the time, it undergoes progressive
refinement. No careful observer can deny that fact. More and more
of our instinctive cravings are gradually throttled. But when the
process of repression becomes too severe there are regressions such
as we have witnessed in the agitation for free love of the last decades
and in the current more frank discussion of sexual matters. But if all
signs do not fail the high tide of the agitation for sexual freedom has
passed and the wave of that agitation is receding. Pioneers in the
movement for sexual freedom are beginning to uphold monogamy;
and the problem of population made pressing by the World War does
not favor the abandonment of the current social and legal
proscriptions against homosexuality. On the contrary. There is likely
to be in the near future a stronger revulsion against homosexuality
inasmuch as society finds itself compelled to revert at all costs back
to the Old Testament attitude of fostering reproduction.
I have already pointed out that the secondary sexual characters are
becoming more strongly accentuated through culture. The
prehistoric stage was probably characterized by an undifferentiated
sexual feeling, such as Max Dessoir ascribes to the pre-adolescent
stage. The polar tension between male and female has increased!
That explains the difference between the old Greek and the modern
attitude towards homosexuality. The Greek was a bisexual being. He
was capable of loving his friend and wife and woman slave alongside
the boy. The modern homosexual, carrying within him the bisexual
instincts of the most archaic developmental stage, finds himself
confronted with another sex-attitude. He is confronted, so to speak,
with the need of making a new choice, and therefore he seeks always
the type to which he himself belongs, the man who is a woman, or
the woman who is a man. Exceptions do not disprove this rule. But in
proportion as the polar tension between the sexes increases, the
basic antagonism between man and woman also grows. As we have
seen—the last case was particularly instructive in that regard—the
homosexual, who apparently stands above that struggle, is inspired
from within by a feeling-attitude of extreme hatred. He hates woman
with such deadly antagonism that the fear of his own passion makes
him avoid woman. His hatred is a will of annihilation. But that
feeling involves its polar alternative: love to the point of self-
annihilation, a willingness to be utterly humbled. Subject No. 83
gives us a history clearly illustrating this interplay of forces.
But it is plain that the number of homosexuals will not decrease.
On the contrary. I am of the opinion that under certain conditions
the extreme polar tension between man and woman will always
drive to homosexuality certain individuals possessing the requisite
bisexual predisposition and that the number of homosexuals will
increase. Since I look upon homosexuality as a neurosis, a morbid
condition, if one insists on the term, I am decidedly opposed to the
policy of penalizing the homosexual, and against those legal
proscriptions which have been and are the cause of much misery. It
is a striking fact that in France and Italy homosexuality plays a lesser
rôle than in Germany, for instance, although in those countries the
offence is not so severely penalized. Dangers and prohibitory laws
often excite the strongest attraction and the neurotic is the very
person who likes to become a martyr. Homosexual relations or acts,
carried on under mutual understanding and with the consent of the
parties thereto, should not come under the province of penal law, as
provided in the Codex Napoleonis. The latter penalizes only public
nuisances (outrage à la pudeur) that is, acts committed in public or
carried on in the presence of witnesses; the Code Napoléon penalizes
coercion and protects the minors and the feeble-minded.
With these provisions the requirements of our current ethical
standards are fully met. I cannot conceive the State compelling the
homosexuals to reproduce. Although I do not accept Tarnowsky’s
viewpoint that their offspring is degenerate,—because personal
observation has often convinced me of the contrary—I look upon the
rise of the homosexual neurosis as a sort of social instinct. The
homosexual possesses an endopsychic perception of his asocial
tendencies. He feels himself beyond the pale of society and does not
care to adjust himself into the social order with regard to his
sexuality. His struggle against reproduction is perhaps best for
society. Considering the strength of his sadistic inclinations we can
appreciate that through his voluntary sterilization in certain cases he
renders society a genuine service.
The question rises whether it is advisable to clear the homosexual’s
path towards woman through psychoanalysis. That brings up the
chief question whether homosexuality is at all amenable to therapy.
My personal experience has convinced me that here and there
psychoanalysis is successful in effecting a cure. But only under
certain conditions. The homosexual must be genuinely willing to be
cured. He must actively desire a change in his leaning.
But experience shows also that this will to health is found only in
the lighter forms of homosexuality in which latent sadism does not
dominate the condition.[50] That in a certain sense the homosexual of
this type is curable I am in a position to affirm on the basis of my
personal experience. The cure proceeds spontaneously but it may be
hastened through psychotherapeutic endeavor.
The proper psychotherapeutic method can never be hypnosis.
What may we expect hypnosis to accomplish so long as the
homosexual himself remains in the dark regarding his false attitude,
so long as he has not learned to acknowledge openly the repressions
against which he has fought so long? Contrary to Krafft-Ebing,
Schrenk-Notzing, and Alfred Fuchs, I have never met with a lasting
cure through hypnotic treatment. We must accept with greatest
caution the statements of homosexuals claiming to have been cured
by us.[51] Case 62 recorded in this work, illustrates that there are
some homosexuals who in order to please the physician and
conclude the treatment with flying colors, claim they are well without
having changed in the least their deeply rooted feeling-attitude.
Moll’s association therapy I am also unable to accept. That method of
treatment consists of the systematic development of normal and the
equally deliberate destruction of the perverse, associations. Moll,
who has proposed this therapy and given it that designation, has the
homosexual cultivate deliberately feminine company so as to come
strongly under the specific female influences, he regulates the
subject’s reading and helps him overcome the homosexual
phantasies. The subject must think of “normal pictures” only, before
going to sleep and thus influence his dreams in the proper direction.
[52]
But one must not think, as Moll concludes, that the heterosexual
dream pictures which follow are due to the association therapy. The
pictures thereby are merely rendered bewusstseinsfähig, tolerable to
consciousness. They were always present. But the patient lacked the
courage to acknowledge them.
I do not mean to deny a certain relative value to the association
method. It is certainly not an advantage for the homosexual who
earnestly strives to get cured to continue to frequent homosexual
circles and to have constantly dinned into his ears the assertion that
his condition is inborn and hopeless. I have quoted some cases
showing that latent homosexuality may become manifest through
contact with and the example of homosexuals while the heterosexual
leaning may be disturbed thereby. But I did not intend to suggest the
advisability of any compulsory measures for restricting the
homosexual’s freedom of action or social intercourse. I have already
expressed myself clearly against compulsions and punishments. It is
advisable to urge the homosexual anxious to get cured to give up
contact with homosexual circles.
But that the association therapy alone is capable of effecting a
complete cure I cannot but doubt. The subject must first learn to see
himself clearly and to recognize the source of the evil against which
he is fighting. We must bear in mind the many subjects with whom
repressed sadism is the true cause of the fear of woman. Such
subjects must first consciously overcome their sadism, they must
recognize that the fear is a ridiculous attempt at protecting
themselves against leanings which under normal conditions never
break through.
The first condition for the successful cure of homosexuality is
adequate self-knowledge. That can be accomplished only through
persistent psychoanalysis. The physician must devote himself to the
subject for some months until the side-tracked leanings which the
patient has stubbornly overlooked are brought into the field of
consciousness and clearly acknowledged. The subject is like a person
with torticollis looking constantly in one direction and avoiding a
turn of his head on account of the pain. This mental torticollis must
be overcome. The homosexual—if he is to get well—must be able to
turn his gaze unrestrictedly over his whole mental horizon.
That is by no means a simple task. It is an achievement challenging
the whole medical art, requiring insight, diplomacy, sympathy,
friendliness, and patience. But few physicians are fitted for the task.
Perhaps the opposition to psychoanalysis would not be so sharp if it
were practiced only by competent psychotherapeutists and
experienced professional men possessing the requisite tact. The
physician is like the sculptor engaged in the task of bringing forth a
certain form out of raw material.
Unfortunately I must point out in this connection that the
psychoanalytic method inaugurated by Freud is in danger of falling
into discredit through careless application. On the one hand the
exaggerations of the master and his pupils have repelled many
practitioners; on the other many of the patients have themselves
become psychoanalysts, without being completely cured of their own
trouble. What would one think of a hydrotherapeutist, expert though
he be in his own specialty, who undertook a laparotomy? Analysis is
comparable to a serious operation requiring a steady, experienced
and skilful hand. Psychoanalysis does not permit dilettantism like
hypnosis. Only from an experienced master may one learn the
difficult art of psychoanalysis and in turn become a master of the art.
It is quite likely that the analysis of today will be ridiculed in the
future as a raw beginning. Various subtleties and gradations remain
to be uncovered by the future generations.
The psychoanalytic realm is not yet completely laid out.
How firmly I held to all the Freudian mechanisms so long as the
deceptive proximity of the great founder confused my own
understanding! How much I had to unlearn, correct, tone down, or
underscore, overcome or forget, or see with a different eye, before I
realized that we are as yet but at the beginnings of our knowledge
and that we must use our present findings as but so many spring
boards to enable us to reach a little farther out! Finally, each
psychotherapeutist formulates in the end his own technique. The
most important prerequisite for psychoanalysis—as for every
scientific investigator—is to approach the subject without any
preconceptions, to look upon every patient as a new problem and
not to be surprised if one’s case does not fit in with one’s ready-
made systems or if it disproves one’s favorite notion. For even the
physician with years of experience is startled to meet so many new
forms under which neurosis manifests itself.
But in spite of the variegated pictures, this bewildering variety of
causes leading to the trouble, one thing remains true and
unalterable: the neurotic’s unwillingness to see, that peculiarity
which Freud has called repression, and the consequent psychic
conflict. We must first appreciate that the patient’s mind is shattered
over the hopeless character of his conflict, that for him the neurosis
is a necessity,—something that enables him in one way or another to
put up with his hardships,—something with which softly to hide his
wounds on the one hand and on the other, show his suffering to the
world; when we appreciate all that, we may gradually acquire the
subtle skill of dissolving the ties and bringing the wound to light. We
see the wound but the patient will not, cannot, see it. He may go so
far as to claim that he has no wound and is well; that he was born
with the ties that bind him; or else, that he came with that wound
into the world.
These difficulties are in no psychoneurosis so great as in
homosexuality. As I have already stated: the homosexual neurosis is
a flight to one’s own sex induced by the sadistic feeling-attitude
towards the opposite sex. It is the task of analysis to uncover the
mental conflict which finds expression in this onesidedness and to
enable the patient to see the cruelty trend which he has derived from
the childhood of the race and has carried through his own childhood
into his adult life. When the homosexual becomes aware of his
bisexuality and sees the causes of his monosexual leaning we have
accomplished the requisite educational task. Beyond that point the
patient must help himself. If he is truly earnest about his desire to
get well he will accomplish it without being pushed to it. If he lacks
the inner will the situation is hopeless in spite of the analysis.
For that reason I am not in favor of the practical management of
homosexuality as carried out by many physicians and particularly by
some psychoanalysts. They urge the homosexual to adopt
heterosexual ways, and consider the subject cured when he is able to
have normal coitus a few times. Unfortunately unpleasant reactions
often follow alleged cures such as are often claimed for persuasion-
therapy and hypnosis. The homosexual abandons all further
attempts and prefers his original monosexual attitude.
We may claim a cure only after the subject under treatment falls in
love with a suitable person of the other sex. Potentia cœundi is not
enough. He must be able to give up dividing the feeling-complex
hatred—love between the two sexes—and to achieve the bipolar
attitude “hatred and love” towards the opposite sex. Such a miracle
only love can perform. Experience proves that the homosexual flees
from the heterosexual love to save himself. The latter looms up in his
mind as a test of power, in which he is anxious to come out the
winner, even at the cost of doing away with his heterosexual partner.
He must accept the subjection to woman implied in love and
recognize that in true love both lovers rule and both obey. He must
also learn to recognize the essential unity of erotism and sexuality.
Only when the homosexual finds it possible to fix his erotism and
sexuality upon the same goal, in a person of the opposite sex,—in
other words, when he learns to love in adult manner,—have we the
right to claim a cure. It is only then, at any rate, that the greatest
healer of all ages, love, achieves its easy victory and the former
patient, like all neurotics, thinks that mere chance has brought him
face to face with his ideal. With that end in view the fixation on the
family—through which the homosexual loses his erotic freedom,
occasionally also the sexual—must be severed. I have brought strong
proofs to show that we must transform the homosexual into a
bisexual being, in order to cure him. Practical experience does not
favor bisexuality. We must reckon with the fact that we live in a
monosexual age. The homosexual must transpose his whole sexuality
and must try to overcome or sublimate his one-sided leanings.
The necessary educational discipline takes a long time. The
treatment of homosexuality therefore is a formidable task, both for
the analyst and for the patient. The end-result of the treatment may
not be known definitely for some years.
I have tried to describe the technique of the analysis in the
individual cases. From those various indications the reader may form
a picture of the difficulties. A systematic account of the technique of
the analysis would require a volume in itself. Perhaps after finishing
my Disorders of the Instincts and Emotions Series I may write such
a work in order to acquaint with my experience the practitioners who
want to grapple with the same problems.
A new generation of physicians, not brought up in the midst of the
prejudices of the older, will further the psychologic investigation of
the neuroses.
Naturally the high school must change its attitude towards the
problem of sex. Departments of Sexology and Psychotherapy are
necessary to instruct the young physicians in the essentials of sexual
life and its morbid changes, in order to prepare the future
practitioner to deal effectively with these troubles, heretofore
erroneously looked upon as hopeless. The next volumes in this Series
will prove how little the paraphilias are inborn and how much they
are the result of training and environment. But what is formulated
through faulty training may be corrected by proper reëducation, even
though the hold of infantilism appears unconquerable.
I have called the paraphilias the struggle between spinal cord and
brain. They are, even more truly, the Struggle of Child against
Adult. For at bottom these neuroses are but infantilisms struggling
for survival. The adult fights against the child; the adult race, ripe for
monosexuality, fights against its childhood manifesting itself in
bisexuality and sadism. The physician can see to it that the warfare is
carried on in humane fashion and with means worthy of civilization.
He can turn the hidden into an open warfare. It means overcoming
the evil—or that which the moralists call evil—by meeting it face to
face.
He who looks for more than a few words on the subject of the
prophylaxis of homosexuality and onanism will be disappointed. I
believe it is best that we turn our attention to these themes only
when we are called upon to do so in our professional capacity. I
advise all parents and educators not to watch whether a child
masturbates or not. The child quits the habit when it finds other
ways for releasing the tension. And our analyses have abundantly
shown us that it is almost impossible to prevent masturbation. The
evil effects produced upon the child witnessing marital bickerings,
the household inspiration it receives with regard to judgment-
feelings about women and men, the decisive manner in which
parents affect it when they transfer their conflicts on the child,—
these capital facts the life histories of homosexuals given above
illustrate very clearly for any one willing to look squarely at the truth.
We do not as yet appreciate how careful we must be in our relations
with the children. Our educators are still guilty of a serious blunder
when they conceive their duty to be to instill goodness in the child
through the instrumentality of fear. There are only two educational
levers: one’s own example and—love. The healthiest children come
from happy marriages. It is love that determines whether a marriage
shall be a happy one and whether the offspring will be healthy or
weak. The unconscious sexual instinct, manifesting itself in love is
the guide for the regeneration of the human race.[53] Social
conditions favoring early love marriages are the only social reform to
which I look for results....
INDEX OF SUBJECTS

Abstinence, 81, 191


Adult Love, 314
Age, 50
Aggressivity, 283
Ahasuerus-Type, 214
Alcoholism, 27, 69, 178, 183
Ambisexuality, 12
Anal Eroticism, 245
Anamnesis (of H.), 231
Anger, 69, 120, 152
Antagonism, 94, 304
Anxiety, 15, 164, 178
neurosis, 28, 76, 191
Asocial (Cravings), 194
Associations, 250
Association Therapy, 307
Atavism, 169, 297
Attachment (to Father), 182
Autism, 173
Aversion, 29, 31, 57, 97
Bipolarity, 157, 206, 218, 265, 283
Bisexuality, 12, 296

Censorship, 267
Christianity, 301
Compromise, 189, 290
Compulsion Neurosis, 192
Conflict, Psychic, 311
Psychology of, 93
Confusion States, 176
Conscience, 144
Coprophilia, 247
Cravings, 180
Creative Energy, 296
Crime Passionelle, 23, 158
Criminality, 13, 18 passim, 20, 70, 133, 138, 144, 151, 157, 187
Culture, 159
Cunnilingus, 209, 216

Day Dreaming, 138


Defence of Jealousy, 123
Degeneration Theory, 282, 296 passim
Delusion of Jealousy, 161
vs. Reality, 177
Depression, 96, 104, 187
Differentiation, Sexual, 294
Disgust, 15, 21, 29, 62, 63, 207
Dorian Love, 300
Dreams, 82, 131 passim, 176, 240, 247, 254 passim, 267, 269, 271,
277
Drinkers’ Jealousy, 183
Drug Addiction, 176, 178
Dyspareunia, 18, 95
Dyspnea, 72

Egoism, 291
Elektra, 195
Engrams, 295
Epilepsy, 22 passim
Ethics, Sexual, 317

Family, Love of, 91


Fancies, Homosexual, 247, 253
Father Complex, 227
Father Imago, 35, 36, 39, 49, 61 passim, 77, 283
Fear, 57, 62, 67
of Sexual Partner, 15 passim, 17, 20, 38
of Women, 286
Feeling-Attitude, 216
Fellatio, 73, 247
Fetichism, 44
Fixation, 47, 70, 79, 81
Emotional, 223
Flight Reflex, 234

Greek Love, 82 passim


Guilty Conscience, 296
Guilt, Feeling of, 207

Hair Symbolism, 262


Hatred, 19, 38, 79, 80, 103, 132, 134, 145, 273, 289, 304
Hermaphroditism, Unilateral, 297
Heterosexuality, 269
Horror Feminae, 14
Hypnosis, 306
Hysteria, 22

Identification, 49, 103, 110


Impotentia, 40, 69
Inability to Love, 289
Inbreeding, 297
Incest Phantasy, 33, 105, 146, 155, 181, 187, 194, 222, 265
Infantile Attitude, 283, 292, 295
Reminiscences, 286
Sexual Theory, 211, 246
Infantilism, 44, 133, 220
Inferiority, Feeling of, 229
Insanity, 156, 158
Fear of, 176, 177
Periodic, 176
Intermediate Sex Theory, 217
Inversion, 41, 43, 49

Jealousy, 76, 102, 109, 127 passim, 131, 135, 156, 292
Judaism, 299
Late Homosexuality, 50
Latent Criminality, 137
Homosexuality, 296, 308
Law of Substitution, 89, 90
Libido, 29, 44, 260
Love, 157
Attitude, 295

Masochism, 207
Masturbation, 16, 55, 64, 66, 155, 230, 245
Maternal Body Phantasy, 268, 272
Melancholia, 118
Monogamy, 303
Monosexuality, 187 passim, 299
Monotheism, Sexual, 193
Mother Imago, 34, 41, 49, 89, 144, 146
Mother-in-Law, 118
Motherhood, 95
Motivations, 159

Narcissism, 47, 48, 91, 269, 291


Neurasthenia, 72
Neurosis, Epileptic, 27
Non-Conscious H., 117

Œdipus, 195
Ontogenesis, 156, 281
Orgasm, 63
Overcleanliness, 266
Over-valuation (of Manliness), 217, 295

Pansexualism, 193
Paranoia, 156, 163, 166, 190
Paraphilia, 200, 219
Pederasty, Epileptic, 26
“Penetrating Eye” Symbolism, 61
Permanence of H., 46
Persecution, Delusion of, 159, 171, 192
Phylogenesis, 156, 281
Philosophy, 39
Polar tension, 293, 303
Pollution Symbolism, 259
Precocity, Sexual, 291
Primordial Hatred, 282
Progression, 297
Projection, Psychic, 159
Prophylaxis, 316
Protection, 80
Pseudo-Heterosexuality, 14
Psychoanalysis, 139, 146, 170, 176, 200, 208, 284, 310
Psychogenesis of H., 105, 181, 280, 298
Paranoia, 171
Psychosexual Infantilism, 148
Psychosis, 156
Puellæ Publica, 194
Purity, 105

Querrulants, 172

Rage, 19, 158


Regression, 90, 132, 163, 194, 195, 282, 292
Religion, 301
Reminiscences, 179
Repressed Sadism, 270
Repression, 34, 43, 49, 190, 194
Revenge Fancies, 169, 292
Revolt, 92
Rivalry, between Sexes, 293

Sadism, 38, 49, 69, 159, 161 passim, 200


Sadistic Trend, 177
Scatologie Fancies, 244, 246, 260
Scent, 46
Scorn, 15, 32
Self-Knowledge, 309
Self-Love, 284, 291
Pathologic, 193
Punishment, 135
Torture, 202
Servant Girl, 119
Severity, Parental, 220
Sexual Infantilism, 260
Sister Imago, 88
Social Abhorrence of H., 298
Specific Phantasy, 78
Spermatozoan Dream, 272
Spiritual Marriage, 166, 264
Sublimation, 88, 90
Submissiveness, 135
Suicide, 76
Supremacy, Struggle for, 220, 222
Symbolism, 44
Sympathetic Act, 111

Telepathy, 186
Tenderness, Craving for, 274
Parental, 220
Third Sex Theory, 15
Transposition, Emotional, 162
Transvestitism, 252, 296
Trauma, Psychic, 98
Tuberculosis, Symbolism of, 233

Uncertainty, 168
Unconscious, 160, 194
Uranism, 34, 189
Urlind, 95, 133, 195, 284
Urning, 14, 31, 33, 47, 48 passim, 194, 284
Urolagnia, 248
Voyeurism, 117
Vomiting, Symptomatic, 242

Warning, 105
Water Closet Symbolism, 244 passim
Wish, 207
Fulfillment, 111
Incestuous, 131, 133

Zoöphily, 155
INDEX OF NAMES

Adler, 15, 222, 285


Aristotle, 299

Beaussart, 155
Berg, 91, 92 passim
Bjerre, 170
Bloch, 14
Bethe, 300 passim
Burchard, 27

Dessoir, 308

Eulenburg, 21, 317

Fehlinger, 294
Fleischmann, 200, 206, 208
Freimark, 93
Freud, 156, 161, 213, 215, 310, 311
Fuchs, 306

Havelock Ellis, 220


Heine, 271
Hirschfeld, 11, 12 passim, 14, 21, 26, 27, 29, 30 passim, 48, 90, 95,
188 passim, 193, 296 passim, 297, 299

Ibsen, 89

Juliusburger, 159, 160

Kafka, 233
Krafft-Ebing, 190 passim

Magnan, 296
Moll, 307

Nietzsche, 10, 11, 198, 199, 288, 289

Oppenheim, 161

Paul (Jean), 138


Platen, 43
Praetorius (Numa), 29

Raffalovich, 284
Rank, 90
Rochefoucauld, 108, 109, 154, 155

Sadger, 36 passim, 38, 39, 43, 46, 48, 71, 285


Schnitzler, 125
Schopenhauer, 52, 53
Schrenk-Notzing, 306
Schrecker, 229
Stekel, 200, 258, 264, 268, 290
Strindberg, 80

Tannenbaum, 125
Tarnowsky, 305

Van Teslaar, 18, 23, 90, 207, 258, 264, 268, 290

Weininger, 80

Ziemcke, 205

1. “Homosexuals who display their inclination clearly only after puberty show
an interest in the other sex before and during the period of puberty. For instance, I
have been told by a 23-year-old typical homosexual, today a victim of horror
feminae, that at 16 and 17 years of age he entertained strong fancies about girls and
ran after them, although without any particular sexual feeling desire. This
transitory and undefined preoccupation of homosexuals with the opposite sex is a
sort of ‘pseudoheterosexuality.’” (Bloch, loc. cit., p. 597.)

2. In vol. III of Disorders of Instincts and Emotions: The Sexual Frigidity of


Woman; Psychopathology of Woman’s Love Life. English translation by Dr.
James S. Van Teslaar.

3. Nervöse Angstzustände, 2nd ed., p. 336.

4. Vol. V. in: Disorders of Instincts and Emotions. English version by Dr. Van
Teslaar.

5. B. Tarnowsky, Die krankhaften Erscheinungen des Geschlechtssinnes (The


Morbid Manifestations of the Sexual Instinct). Eine forensisch-psychiatrische
Studie. Berlin, 1886, p. 51 ff.
6. Jahrbuch f. sexuelle Zwischenstufen, vol. IX, 1908, p. 504.

7. Fragment der Psychoanalyse eines Homosexuellen (Jahrb. f. sexuelle


Zwischenstufen, vol. IX, 1908). [A typical illustration of the wrong way of carrying
on a psychoanalysis, the kind of painful ordeal during which the subject calls out in
distress: “But, pardon me, what must I tell you? You just torture me, nothing less!”
The most important relations are overlooked, the patient is tortured to admit that
he is in love with Sadger, so that after fourteen hours of this sort of torment he
runs off.]

8. J. Sadger: Ist die konträre Sexualempfindung heilbar? Zeitschr. f.


Sexualwissenschaft, 1908, p. 712.

9. Jahrb. f. psychoanalytische u. psychopathol. Forschungen, vol. II, 1910.

10. Ibsen, the great psychologist, has described in masterly fashion the
transposition of sister love into boy love. In “Little Eyolf,” Almers, the writer,
suddenly loses the love for his wife and turns his affection exclusively to his child.
That child is called ‘little Eyolf,’ like his sister, who had once put on boy’s clothes
and called herself ‘little Eyolf.’ The parents had expected a boy. Almers turns his
affection for the sister, which pervades the whole drama, into the love for the boy.
He has discovered for himself the law of substitution which corresponds to the
changes spoken of in these pages. Little Eyolf in fact is the dramatisation of the
latent homosexual fixation on the sister. Almers cannot split his personality, he
cannot be both homo- and heterosexual. This inability to split his self, the root of
all homosexuality, forms the background of the whole drama. Rita cannot divide
her personality any more than Almers can do it; he must give his whole personality
self. Almers cannot divide wife and sister. He embraces his wife and thinks of the
sister (That sister, whom he calls his little and his big Eyolf. The sister in trousers,
who embodied his ideal, a woman in male clothes, a bisexual being which need not
be split up at all). “Love of brothers and sisters is the only relationship not subject
to the law of transformation.” Rank (Das Inzestmotiv in Dichtung und Sage, 1919,
p. 654) and Pfister (Anwendung der Psychoanalyse in der Pädagogik und
Seelsorge, p. 72) find the incest motive easily but overlook the fact that the
situation involves the outbreak of homosexuality and its psychogenesis. It
represents a flight from the sister to man, a wavering homosexuality sublimated
into love for the boy. The drama contains numerous other familiar points well
worth careful analysis. For Almers, his wife, and his child, are the representatives
of the male, female, and infantile components which we endeavor to synthetize in
our character (trinity). Regression to the infantile level sets in with flight from the
world (flight to the solitude of the mountain top). The solitary Ibsen, as road
builder, undertakes to construct a new highway which shall lead up to solitary
heights and does not observe that the road leads really straight back to the realm of
his youth. Somewhere in the vast expanse of his soul the ‘dead child’ is floating
around and staring with wide open eyes into infinity. A child is killed in this
drama. It stands for the miscarried regression back to infantilism. Childhood is
finally subdued and forgetfulness once more drowns in the soul’s vast expanse all
gnawing and biting reproaches. The memories are all dead ... and the next drama
has for its theme: When the dead awaken. But in little Eyolf they are already
awake.... The dead, whom Ibsen carried in his breast, the corpse to which Rita
refers so often.... The child in him is dead and now the man in him also threatens
to die. It recalls the admission of impotence, described with such tremendous
realism in the great Rita-Almers scene. The man in him dies and the woman in him
persists with yearnings. A more detailed treatment of these endopsychic processes
will be found in my book on Masochism (Translation by Van Teslaar, in
preparation).

11. The following passage, from an observation by Hirschfeld, shows how early
such fixation on the brother may take place, only to disappear, apparently, and to
be mistaken for inborn homosexuality: “I hated boys and boyish games; my sister
was my alter ego, while my brother, who was 13 years older and a very beautiful
man, had powerfully charmed my childish, pure and innocent heart. I worshipped
him for his physical beauty even more than on account of his sterling qualities. At
the same time I grew continuously more sensitive in my overt attitude towards
him. I remember clearly that during the 6th or 7th year my brother’s physical
beauty caused me to shake before him with every fiber of my body in admiration as
before some mystery revealed. At 10 years of age I wept through a whole night
intoxicated with joy because it fell to my lot to lie down near his intoxicatingly
sweet presence for rest. I had a feeling of shame such as I did not experience in the
presence of my mother or sister. Clearly and deliberately, although unbeknown, of
course, to him, I deified my brother from the 10th to the 15th year, and this
worshipful attitude reached its highest from my 10th to the 12th year, when he
married. I was disconsolately unhappy over it because that event removed him
from our midst and I felt it was dreadful that he should lose his virgin beauty, as I
thought.” (Hirschfeld, loc. cit., p. 46.)

12. Zuchtbarkeit der Homosexualität. Sexualprobleme, 6 Jahrg., 1910, No. 12.

13. This thought is very wonderfully expressed in Gerhart Hauptmann’s


Griseldis. The father is jealous of the son because he, in turn, had been his father’s
enemy and rival....

14. Cf. chapter on Jealousy in my collection of essays, “Was am Grunde der


Seele ruht...,” Wien, 1909, Hofbuchhandlung Paul Knepler. English Version, The
Depths of the Soul, translated by Dr. S. A. Tannenbaum, Moffat, Yard & Co., N. Y.

15. With his wonderful psychologic mastery Arthur Schnitzler has described
such a pair in his best piece entitled, “Das weite Land.” Hofrichter, the
manufacturer, who flutters from one love affair to another, and his wife, who
consoles herself in the arms of a young Cadet, are the kind of a pair who love each
other but go down in ruin rather than openly acknowledge their love.
16. Cf. chapter entitled, “Der Kampf der Geschlechter,” in my work, The
Beloved Ego, translated by Dr. S. A. Tannenbaum, Moffat, Yard & Co., N. Y.

17. The flaring up of jealousy in old age during exhaustive conditions, an


extraordinarily common occurrence, seems to be determined partly by endocrinic
disorders and partly by the awakening of infantile predispositions. We also find
frequent mention of the fact that morbid jealousy manifests itself after a prolonged
convalescence in bed. Some physicians are inclined to trace the condition back to
an intoxication. It seems to me more likely that the unusual opportunity of mulling
things over in the mind is more likely the cause. We must also take into
consideration that facing closely the possibility of death all ungratified wishes,
including the homosexual, once more flare up, urgently pressing for gratification.
This alone may lead to the flaring up also of paraphilias and homosexual
tendencies during old age, when it must also be considered that on account of
organic changes in the brain cortex the inhibitions are also weakened. I have
repeatedly noticed that nursing care by a person of the same sex as the patient also
plays a certain rôle. I have even seen directly as a consequence of prolonged
invalidism the development of a homosexual feeling-attitude towards the nursing
person, for instance, the flaring up of a passion for mother or sister. Regressions
back into childhood frequently occur after infectious diseases. All the various
infantile attitudes manifest themselves. Psychosexual infantilism, a subject which
will be fully treated in a forthcoming volume of our “Disorders of the Emotions
and the Instincts,” is most likely to break out particularly after a period of illness
when one feels one’s self again a child.

18. Cf. Willy Schmidt, Inzestuöser Eifersuchtswahn, Gross’ Archiv, vol. LVII,
1914, p. 257.

19. Zur Radikalbehandlung der chronischen Paranoia. Jahrbuch f.


psychoanalytische Forsch., Vol. III, 1912.

20. A symbolic representation of the identification of myself with the father.

21. A form of sexual disorder not infrequent among neurotics, suggesting a


different sexual objective.

22. Hirschfeld naturally traces this morbid tendency back to the social
ostracism of the homosexual. In my opinion that is a forced explanation. The very
proneness of the homosexuals to affective disorders, their heightened sensibility,
their morbid irritability, their endogenous depression prove that all homosexuals
are severe neurotics. Hirschfeld may be able to trace the homosexual’s acute
outbreaks of affective psychoses back to the actual conflicts. But it is impossible to
link this heightened affectivity to the feminine attitude of the urnings. For if it were
so, how could we explain the equally distressing analogous disorders among the
urlinds? Hirschfeld refers to the anxiety states of the homosexuals (p. 916) and
expressly states:
“This very condition is found frequently also among homosexuals who are
psychically normal so far as their home relations are concerned.”
No—they are not normal with regard to home relations, they are severe
neurotics on account of the repression of their heterosexuality. Superficial
appearances are deceptive and many a person who appears outwardly to be the
picture of health, a well balanced temperament, is inwardly the victim of a serious
neurosis.... Hirschfeld refers further to the homosexual’s proneness to persecution
manias and to delusions of reference. Concerning homosexual women he states:
“Compelled against their inclination to fulfill their marital duties the
homosexual women become very nervous and, in addition to anxiety attacks, they
suffer severe depressions.”...
How does Hirschfeld know that the depressions are due to the enforced
fulfillment of marital duties? I know homosexual women who are divorced and
suffer even more; I know homosexual unmarried women, who are as neurotic as
the married women, and, like the latter, suffer of serious depressions. All these
facts prove that the homosexual pays for his monosexuality just as dearly as the
neurotic monosexual who is heterosexual.

23. Cf. Stekel, Berufswahl und Neurose, Gross’ Archiv, vol. XIX.

24. Beiträge zur Lehre von der konträrer Sexualempfindung Zeitschr. f.


Psychol. u. Neurol., vol. VII, 1911.

25. I have at the present time under observation a soldier who for about three
weeks masturbated 15 times (!) daily. Advanced hypochondriac. The motive seems
to have been the development of a neurosis so he would be freed of military
service.

26. The history of the same patient, as given by Ziemcke, refers to the same
episode as follows: “At 17 years of age the first coitus with a peasant girl,
pleasurable, no disorder.” A proof that the heterosexual episodes are always
corrected in memory and modified in favor of a homosexual predisposition.

27. Regarding this occurrence Ziemcke relates: “Towards the last of his studies
at Kiel he brought to his room a 12-year-old boy from the street under the pretext
of carrying some books for him. When the boy returned he suggested making some
experiments on him, tapped him first on the knee cap, then had him take off his
stockings and kneel on the edge of the lowermost cabinet drawer; next he forced
the boy to stand up stripped to the waist while he pricked him with a pen in the
armpit and under the fingernails. After that he hung him by a rope tied around his
hands, but the rope broke. Then he had the boy lie down on the sofa, lowered his
trousers so as to expose the hips and gluteal region and proposed to pay the boy 5
pfennig for every one of 50 cane strokes. After the 43rd stroke the boy could not
endure the pain any longer, so he increased the pay to 10 pfennig and gave him 5
additional strokes. It has been ascertained that the man had been drinking hard
the night before carousing until daylight and according to his own testimony he
was very nervous next day and had palpitation of the heart. He also stated that he
had acted impulsively; he remembered well all the details of the occurrence but
everything took place as in a haze. After the deed he had a feeling of relief, his
usual excitement and unrest promptly subsided. Examination showed nothing
physically abnormal and absence of any serious intellectual defect as well.”

28. The volume on Sadism and Masochism, in my Series on the Disorders of


the Instincts and of the Emotions. English version by Van Teslaar.

29. At a meeting of the medical society in Odessa, a colleague was presented as


one who had been treated unsuccessfully by me. He suffered compulsions of a
most serious character and was one week under my care. I had proposed three
months. Nevertheless he was brought forth as proof of the inefficacy of
psychoanalysis. It happened that colleague Dr. W. was present, and he knew that
the alleged analysis was of one week’s duration. He was able to apprise the meeting
of the fact. In a few weeks that honorable sick physician placed himself under the
professional care of Dr. W....

30. An “infantile sexual theory,” in which coitus is conceived sadistically as a


squeezing.

31. Zentralblatt für Psychoanalyse, Vol. IV.

32. Cf. also my essay, Der Kampf der Geschlechter, the Struggle between the
Sexes, in my work, The Beloved Ego, Moffat, Yard & Co., N. Y. I have now under
treatment a very sick woman who has gone to pieces over a similar problem. She
was anesthetic with all men. The one man who had just once roused her during
sexual intercourse she hated and could kill.

33. Havelock Ellis and Moll (Handbuch der Sexualwissenschaften, Leipzig, F.


C. W. Vogel, 1912) draw attention to this fact: “Both sexes often show a remarkable
youthfulness in appearance which is preserved late into the adult state. The love of
green, which is chiefly, normally, a favorite color with children, and especially with
girls, is often observed. A certain degree of histrionic talent is not uncommon as
well as an inclination towards tenderness, occasionally also a feminine love of
adornments and jewels. It may be said of many of these physical and psychic
characteristics that they denote a certain degree of infantilism, and this fits in with
the view that homosexuality is traceable to aboriginal bisexuality; for the deeper
we penetrate into the life history of the individual, the nearer we approach the
bisexual stage.”

34. Dr. Paul Schrecker, Die Individualpsychologische Bedeutung der


Kindheitserrinnerungen, Zentralbl. f. Psychoanalyse, Vol. IV.
35. Cp. the novel by Kafka, Die Verwandlung (Verlag von Kurt Wolff). It
portrays the transformation of a man into a bedbug. It is obviously a sadistic fancy
(the bedbug sucks blood). This meaning is not imparted to the patient so as not to
influence the course of his associations.

36. The mouth as an erogenous zone. He expected kisses and meanwhile was
satisfied with other sweets as a substitute. He is a confirmed lover of dainties and
still relies on sweets which he is in the habit of carrying in his pockets.

37. This is a thought which troubles many neurotics. It is their way of belittling
the persons who impress them and who thus make them realize their own
inferiority.

38. Later will be shown the sadistic meaning of this phantasy. Urine is often a
substitute for blood in the dream....

39. Cp. the boxes in the first dream (Merchant of Venice).

40. Cp. Sex and Dreams: The Language of Dreams, vol. I. Translation by
James S. Van Teslaar.

41. Cp. Chapter on Maternal Body Dreams, in work mentioned above, Vol. II.

42. In the Tristan phantasy these reminiscences return. The father is the
betrayed King. The episode of the father’s departure in that dream becomes clear
only now. He died in time to avoid the experience of a second deception in love.

43. Cp. my laws of symbolic equivalents in Language of Dreams: All


secretions and excreta are equal to one another as symbols.

44. Raffalovich, author of a small monograph on Die Entwickelung der


Homosexualität (The Development of H.), Berlin, 1895, states in a few pages more
truths than many authors disclose in heavy volumes of writing. He states, for
instance, that “there are no distinct barriers between heterosexuals and
homosexuals.” He also emphasizes the strong self-love of homosexuals: “They have
die Leidenschaft der Æhnlichkeit.”

45. Page 248, of the German edition. “The neurotic’s attachment to the family
is an overcorrection of former lack of love and is induced by a feeling of remorse.”
“Poets formulate a longing for love because of their inability to love and that drives
them to their continuous chase after love adventure. Love becomes the
overstressed idea and the unattainable ideal of poets.” “The poet differs from the
criminal because he is aware of his incapacity to love as a handicap, and from
hatred and scorn of humanity he turns to love his fellow men.”
46. Domestikation und die secundären Geschlechtsmerkmale. Zeitschrift f.
Sexualwissenschaft, Vol. III, No. 6–7, 1916.

47. An excellent account of the history of homosexuality may be found in the


work of Hirschfeld (loc. cit.).

48. Politics, II. Quoted after Havelock Ellis and I. A. Symonds, Das konträre
Geschlechtsgefühl, Leipzig, George H. Wiegands Verlag, 1896.

49. Die dorische Knabenliebe (Ihre Ethik and ihre Idee), Rheinisches Museum
f. Philologie (Neue Folge), vol. 69, 1907.
The authors prove that boy love in Hellas was introduced by the Dorians.
Although traces of the custom are found also among the Ionians, boy love, like
knighthood, became fashionable in Greece through the Dorians. “It was permitted
only to the free citizen, the knight, while slaves were forbidden to indulge in the
practice often under penalty of death. The practice was regulated by strict rules
and became a state institution. In Sparta, Crete, Thebes the training for (arety)
ἀρεθή, among the dominant class was based on pederasty. The lovers in Sparta
were held to a strict accountability for their ‘companions’ who became attached to
them from their 12th year; so that they and not their youthful companions were
punished for any shameful act on the part of the latter.” “The battlefield at
Chaironeia was covered with the lovers ... lying in pairs.” In Crete the choice of boy
lovers assumed the form of bridal theft. The lover advised the boy’s family of his
intention of stealing the boy. If the family did not like the “match” it tried to avoid
the capture of the boy. The higher the lover’s social position the greater was the
honor felt by the boy and his family. The chosen one was afterwards sent home
carrying gifts....
In fact, at Thebes, Thera and in Crete such unions even enjoyed religious
sanction. “The engagement of the lovers or rather their physical union certainty
occurred under the protection of some god or hero at Thera and at Thebes. At
Thebes we find the language unmistakably clear in the high archaic field
inscriptions of the Seventh Century, chiselled in large letters upon the holy
promontory near the City, at a distance of 50–70 meters from the temple of Apollo
Karneios and on the holy site dedicated to Zeus. They read as follows: “On this
holy place, under protection of Zeus, Kerion has consummated his union with the
son of Bathykles and proclaiming it proudly to the world dedicates to it this
imperishable memorial. And many Thereans with him, and after him, have united
themselves with their boys on this same holy spot.””
At Crete it was considered a shame for a boy to possess no knightly lover. On
the other hand it was a great honor for a boy to be wanted by many lovers.
For the lovers and for the boys these relations had an excellent effect. Each
was inspired to do his best in order to prove his mettle and be ἀγαθός ανήρ
(agathoi anyr). The heroic tales even took note of this love. The wondrous deeds of
a Herakles were carried out in honor of the male lover Eurystheus. Repelling a
wooing knight was considered ignominious,—a blot on one’s honor. Plutarch
relates the story how Aristodamus struck down with his sword an obstinate boy:
“Man gerät unwilkürlich in die Sprache unseres ritterlichen Ehrenkomments,”—
states Bethe.
With that act the knight transferred his ἀρετή (arety), knighthood, upon the
boy. It had a symbolic meaning. Among the Spartans the pæderast was called
εἰοπνήλας (eiopnylas), from εἰοπνειν (eiopnein), meaning, the one who blows
something in (the inblower). But what was it that the pederast blew into the boy?
Clearly the πνευμα (pneuma), the soul, a belief which has come down from the
oldest period (Bible) surviving to this day in Christianity. According to primitive
conceptions the soul of man resided in his various secreta and excreta. Urine,
fæces, blood and semen were magical substances inasmuch as they contained the
life principle. With his male seed the Dorian endowed his boy with knightly
prowess. (Similarly the savages in New Guinea drink the urine of the chieftain in
order to acquire his skill and strength. Bethe mentions numerous similar
instances.) The semen was regarded as the seat of the soul.
Bethe points out also that the liver, the heart and more particularly the phallus
were similarly identified with the soul. The reader is referred to the original study
for further details.
The remarkable notion of blowing one’s soul into another a posteriori, is
traced by the author to primitive beliefs. Animals showed no objection to these
love-offerings; and men who ascribed magical properties to urine and fæces
undoubtedly lacked any feeling of revulsion against these excreta.... Since the anus
was looked upon as the portal for angry demons, why should not the benevolent
magical power of heroes be introduced the same way?
“The notion which led to the development of pæderasty as a State Institution
among the Dorians, could not long endure. It had to give way finally.... But boy
love persisted as a widespread custom and stood throughout antiquity and
throughout the whole extent of Greek culture as a necessary feature of decent
superior Greek citizenship. The Christian church fought the heathen custom from
the beginning and was the first to drive pæderasty from Christian society; unable
to root it out by spiritual means, it adopted criminal punishment in the year 342.”
That is, briefly, the philologist’s account, who also states that during the pre-
Doric period (Homer, for instance) the custom of boy love had as yet no roots as an
Institution.

50. Zur Psychologie der Vita Sexualis, Allg. Zeitschr. f. Psychol., 1894.

51. I am unable to corroborate the contention of Ferenczi in his Zur Nosologie


der männlichen Homosexualität (Homoerotik), published in Zeitschrift f. ärztl.
Psychoanalyse, Vol. II, 189, 1914. He assumes two forms of homosexuality: 1. the
passive subject-homoerotic, who represents an inborn state and stands for an
intermediary type in Hirschfeld’s sense and is incurable and 2. the active object-
homoerotic, a type he describes as a special form of compulsion neurosis. The
passive type never consults the physician for his trouble,—he is a genuine
homosexual; the active type is unhappy over his condition, he shows the typical
symptoms. Both share in common the peculiarity that their own sex is an essential
condition for the attainment of their love-object and remains so throughout life.
I have seen many homosexuals who are interchangeably active or passive. On
the other hand I have seen active homosexuals who were very much troubled over
their condition and passive homosexuals who have been cured. Incidentally I may
mention that Ferenczi borrows thoughts from my essay on Masken der
Homosexualität, without indicating the source. Since Freud has decreed against
me his anathema, the narrower Freudian school looks upon my work as common
property to be appropriated at will by any one.

52. Handbuch der Sexualwissenschaften, p. 664.

53. A new orientation in matters of sexual morality is on the way in spite of


tremendous opposition. I refer those interested to Eulenburg’s excellent work,
Moral und Sexualität (Verlag, Marcus & Webster, Bonn, 1916).

You might also like