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 7192851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:02:23+00:00 2026-05-28T20:02:23+00:00

I’m new to Ruby and Ruby on Rails. I’m making a sample app (not

  • 0

I’m new to Ruby and Ruby on Rails.

I’m making a sample app (not using scaffolding) to insert a row into a table. Table has 2 columns, “name” and “description” (along with the 3 magic columns).

In my view, I have something that looks like this:

<h1>New Location</h1>
    <%= form_for(@location) do |l| %>
    <div class="field">
        <%= l.label :name %><br />
        <%= l.text_field :name %>
    </div>
    <div class="field">
        <%= l.label :description %><br />
        <%= l.text_field :description %>
    </div>
    <div class="actions">
         <%= l.submit "Add" %>
    </div>

And controller:

class LocationsController < ApplicationController
    def new
        @location = Location.new
    end

    def create
            @location = Location.new(params[:location])
            @location.save #fails on this line
            redirect_to @location
    end
end

Model code:

class Location < ActiveRecord::Base
    attr_accessible :name, :description
    has_many :foods
end

This is what the console prints out:

Started POST "/locations" for 127.0.0.1 at Wed Jan 25 17:09:22 -0500 2012
Processing by LocationsController#create as HTML
Parameters: {"commit"=>"Add", "location"=>{"name"=>"name", "description"=>"description"}, "authenticity_token"=>"7rT1/3qSn/Kz1cGg8iTFCKbkO0W/L7ETT+lNcSSN6FI=", "utf8"=>"\342\234\223"} (0.1ms)  begin transaction
SQL (5081.3ms)  INSERT INTO "locations" ("created_at", "description", "name", "updated_at") VALUES (?, ?, ?, ?)  [["created_at", Wed, 25 Jan 2012 22:09:22 UTC +00:00], ["description", "description"], ["name", "name"], ["updated_at", Wed, 25 Jan 2012 22:09:22 UTC +00:00]]
SQLite3::BusyException: database is locked: INSERT INTO "locations" ("created_at", "description", "name", "updated_at") VALUES (?, ?, ?, ?)
(0.2ms)  rollback transaction
SQLite3::BusyException: cannot rollback transaction - SQL statements in progress: rollback transaction 
Completed 500 Internal Server Error in 5084ms

ActiveRecord::StatementInvalid (SQLite3::BusyException: cannot rollback transaction - SQL statements in progress: rollback transaction): app/controllers/locations_controller.rb:8:in `create'

Rendered /Library/Ruby/Gems/1.8/gems/actionpack 3.2.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.8ms)
Rendered /Library/Ruby/Gems/1.8/gems/actionpack 3.2.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms)
Rendered /Library/Ruby/Gems/1.8/gems/actionpack 3.2.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (3.9ms)

tl;dr: calling .save fails and returns SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction

  • 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-28T20:02:24+00:00Added an answer on May 28, 2026 at 8:02 pm

    This error gives it away:

    SQLite3::BusyException: database is locked
    

    There’s probably another process running that is using the database at the same time.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.