Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 340931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:39:43+00:00 2026-05-12T10:39:43+00:00

Bill Karwin has a blog post called Why Should You Use An ORM ?

  • 0

Bill Karwin has a blog post called “Why Should You Use An ORM?” which is being discussed on Reddit and I was confused about a couple of points.

In it he says in the comments section:

OODBMS and ORM works only on objects
that we’ve instantiated in the
application layer. I.e. there’s no way
to do a query like this:

UPDATE Bugs SET status = ‘CLOSED’
WHERE status = ‘OPEN’;

To do this in an ORM or an OODBMS, you’d have to fetch all bugs that
match the criteria and instantiate
objects for them.
Then you could set
the attribute and save the objects
back to the database one by one. This
is expensive and certainly requires
more code than the equivalent SQL
operation shown above.

This illustrates an advantage of a
language like SQL that treats sets as
a first-class data type. The OO
paradigm cannot substitute for the
relational paradigm in all cases.
There are some ordinary operations
that SQL can do much better.

I bolded the part where he says you have to instantiate objects for these bugs when you use an ORM because that’s the part I’m confused about.

My question is why do you have to? Okay, object-oriented is one thing and relational is another. But is it really true that they are so different that there is no way to represent an object so that it can be understood by the relational database? For example, I’m thinking about how you can serialize an object and then it gets written into a file-storable format. Couldn’t you use a format like that to transfer the object to a relational database?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:39:44+00:00Added an answer on May 12, 2026 at 10:39 am

    is [there] no way to represent an object so that it can be understood by the relational database?

    You’ve missed the point of my statements. I didn’t mean that one couldn’t store an object in a relational database. I meant that the OO paradigm assumes you have an instance of that object in application space. That is, you can call methods and access properties of an object:

    $bug->status = 'CLOSED';
    $bug->save();
    

    But in any ORM I’ve seen*, you can’t operate on an object instance without first fetching it from the database. Nor can you operate on whole sets of rows at a time, as you can with SQL.

    It would be interesting to see an ORM package that had an object type mapping to a set of data. Then when you change an attribute, it applies to all rows in that set. I haven’t seen any ORM attempt to do this.

    It would be very challenging, because of concurrency issues. Does the set include rows that were in that set when you instantiated the object, or when you execute the change, or when you save the changes? If it supports all these permutations as options, then it starts to get so complex to use that one might rightly think that it represents no actual improvement over using SQL directly.

    Re your comment: It’s not that sets and objects are incompatible. A set can be an object (Java even has classes for Collection and Set). But the OO paradigm assumes operations apply to one object instance, whereas relational operators always apply to sets (a set of one row is still a set). And in reality, ORM packages that exist today make the same assumption, that one can change only one instance of a row at a time, and you must have fetched that row before you can change it.

    It’s possibly in theory to expand the capabilities of an ORM to work on sets — but AFAIK no one has tried to do this. My claim is that an ORM that could do all of what relational operators can do would be much worse to use than SQL.

    * I am excluding SQL-like pseudolanguages like HQL, that happen to be part of an ORM package (Hibernate in the case of HQL) but that pseudolanguage itself doesn’t qualify as an ORM.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 217k
  • Answers 217k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer As stated by Robert Harvey, Moq is a library for… May 12, 2026 at 11:17 pm
  • Editorial Team
    Editorial Team added an answer This is all very subjective, but generally for C++ I… May 12, 2026 at 11:17 pm
  • Editorial Team
    Editorial Team added an answer It will work if you skip visibility checks. Change this… May 12, 2026 at 11:17 pm

Related Questions

Occasionally I'll write a PHP function with a single input, an associative array containing
I have a table of user access sessions which records website visitor activity: accessid,
Let's say we're having an application which should be able to store all kind
EDIT: Updated with suggestions from Bill Karwin below. Still very slow. I'm trying to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.