similar to: DB/ActiveRecord optimization of BLOBs

Displaying 20 results from an estimated 60000 matches similar to: "DB/ActiveRecord optimization of BLOBs"

2006 Mar 21
4
activerecord - mysql blobs...
I''m struggling with activerecord and mysql blobs (uploading files)... blobs over 400K-ish cause the below exception... ActiveRecord::StatementInvalid in File#upload Mysql::Error: Lost connection to MySQL server during query: I''ve tried blob, mediumblob, and longblob... I''m using windows xp for development - and have not installed the mysql gem... simlar google
2008 May 07
0
ActiveRecord & SQLite3 Blobs
There is a problem with blobs in ActiveRecord when you''re using sqlite3: sql length limits. Sqlite3 limits the size of the sql queries to 1mb. Because AR puts everything into the sql text, you can''t insert a blob or a clob that is larger than about a meg. That sucks. So I''m trying to fix that, but there''s a problem (obviously, or I wouldn''t be
2007 May 25
7
Storing large BLOBs in the database with ActiveRecord
I have a model called Product with an attribute called file of type :binary (DB BLOB). If I do product.save (where product is an instance of my Product model), here is SQL statement that the mysql adapter for Ruby will do: INSERT INTO `PRODUCT` COLUMNS(NAME, PRICE, FILE) VALUES(''PROD1'', 4.56, X''00DEF033423023220'') All is hunky dory for as long as my BLOB is
2006 Apr 02
2
Delaying table attribute load using ActiveRecord
Hi all, I came accross the following problem lately: I got a table with several BLOB fields (Oracle DB) and I have ActiveRecord reading those fields whenever records are loaded using finder methods. This behavior is just fine in 99.9% of the time, but considering BLOB data is not small, it is considerably slowing down search access :(. So basically, I thought about building a :has_one
2006 Jul 27
2
ActiveRecord retrieval style? Lazy initialtization?
I''m using ActiveRecord for an Extract and Transform operation, so it is outside of its native environment of Rails. I am running into a problem with memory consumption when I retrieve large amounts of data. By large amounts I am talking about roughly 12,700 records that each have a one to many relationship with about 15 additional types of information. One of those types happens
2006 Jan 13
1
ActiveRecord: using with multiple threads/DB connections
Hi, I''m totally new to Ruby and Rails and I''m trying to set up a prototype web site. Unfortunately, I''m having problems with ActiveRecord using multiple threads. What I want to do is fairly simple. I have a Controller that receives and saves data from the web in the DB, but once that''s done I want to process this data in another thread and then save the
2006 Apr 14
1
CLOB handling in ActiveRecord 1.14.2
We recently switched to Rails 1.1.2, which includes the latest version of ActiveRecord. This version seems to have introduced an error with the handling of non-binary large objects. The OCI adapter in 1.13.2 seemed to have treated CLOB and BLOB identically. The new Oracle adapter distinguishes between the two types and gives CLOB a type of :text, where as BLOB are :binary When it comes to
2012 Aug 05
0
ActiveRecord::Validator vs ActiveModel::Validator
I know that there is an ActiveModel Validator class https://github.com/rails/rails/blob/master/activemodel/lib/active_model/validator.rb which is used for the class level validation macros. But I didn''t find a an ActiveRecord Validator class. From my understanding in Rails 3, validations have been moved into ActiveModel to leave ActiveRecord as an ORM. So now I see this Rails 3 code
2012 Apr 17
0
Request for adding an "alias"/"as" to ActiveRecord
I often find myself in situations where I''m fighting against ActiveRecord because there is no easy way to alias some tables. For example, I''m converting a legacy application. So, there is a ''condition_type'' table that actually should be something like ''fields''. Also it can have a parent field and deletion is handled by setting a
2006 Jun 28
0
ActiveRecord mapping users to icons
In a simple webapp containing users and user icons, what''s the right way to use ActiveRecord to store these objects and then designate a single ''primary'' icon for each user, given: - a set of users. - for each user, zero or more icons they''ve uploaded (tied to their account). - for each user, zero or one icon from their set of uploaded icons designated as
2006 Jan 08
0
migration with blobs
Hi all, I am trying to use migrate on my application and works great except for the blob elements in my schema. MYSQL wants me to declare LARGEBLOB for images the size I need to store but unfortunatly migrate seems to just declare :binary as plain ol'' blobs. I like the idea of a database agnostic database description but I''d like to find away to specify the size of the blob
2006 Apr 23
4
ActiveRecord: Exclude some columns while fetching
I have models with large TEXT, BLOB columns and I don''t wanna fetch them everytime. Is it possible to omit columns when fetching records from DB? Sorry, if it''s trivial, but I can''t find helpful information in docs.
2009 Aug 10
1
[PATCH server] Fixed db-omatic so it doesn't die due to an unhandled ActiveRecord::StaleObjectError exception.
The error is caused by the save! method updating an object that another thread (most likely in taskomatic) already updated. In the case of this race condition, we retry saving. However, a proper fix would involve fixing the locking. --- src/db-omatic/db_omatic.rb | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/db-omatic/db_omatic.rb
2010 Aug 16
2
Form validation and processing w/o model (no Db/ActiveRecord)
All - Trying not to fight rails on this, basically have a form and all the same as would be with an ActiveRecord model except that there is no table. I started out using this article: http://stackoverflow.com/questions/315850/rails-model-without-database ...which is kind of a hack by inheriting ActiveRecord in to non-AR model but am running into some problems and just have the feeling that I am
2005 Dec 28
1
Model from DB generator
Hello all, Does a generator exist to generate the ActiveRecord model from the database? I wouldn''t mind if it generated parent-child relations always as has_many - belongs_to. The scenario in my case is a database of about 180 legacy tables, with a pattern that the foreign keys use (<parent table name>_OID). These I''d like to wrap in the model as easily as
2005 Mar 07
5
Asterisk & MySQL Blobs
Hello Folks, Has anyone had production experience using * w/ MySQL Blobs to store sound files? The application I am working on requires all user data resides in a database. I am currently reading/writing the files to disk via a phpagi scripts but I would love to read the blob into a variable in the dial plan, etc. It seems like a waste of resources to write and delete the file.
2009 Jun 09
2
ActiveRecord subclass with manual DB connection can’t directly access column variables.
Hi All, I''m having a slight issue with one of my Rails models. It''s nothing I can''t work around (as I''ve already done so), but I''m interested in the actual issue. Basically, I have an ActiveRecord-based class named "Events" that I''ve connected to a remote database using "establish_connection". It all works fine and I can
2009 Mar 17
4
Preventing a submitted hash from ActiveRecord DB store
Hi all, I have a multi model form (Project with many tasks) and I want to prevent a task from being saved to the DB if it is empty ie. if there is no i/p for that task from the user. I tried the following class Task < ActiveRecord::Base before_save :check_if_empty ... def check_if_empty self.destroy if description.blank? end but i get this TypeError in ProjectsController#create
2009 Jul 29
0
Problem uploading file to database mysql blob field
Hi All, Please help me ,I need to look into this issue asap, I need to change the redmine functionality of uploading files to disk to upload them to database. I tried suggestion on http://dizzy.co.uk/ruby_on_rails/contents/store-file-uploads-in-database but no luck , My form is multipart but still getting the error. Please bare with me I am new to ruby and rails. Here is the like for my
2018 May 18
0
[PATCH] daemon: inspect: better handling windows drive mapping.
I have several Windows disk images which contains strange registry entry for mapped drives: "\\DosDevices\\Y:"=hex(3):00,00,00,00,00,00,00,00,00,00,00,00 Which is decoded something like diskID = 0x0, partition starts at 0 bytes from the start of the disk. In addition of Windows disk image I have attached dummy disk and made xfs file system on a whole device without partitioning it. I