Hibernate @OneToMany remove child from list when updating parent

Instead of replacing the collection (team.setUserTeamRoles(new HashSet<UserTeamRole>());) you have to clear() the existing one. This happens because if Hibernate loads the entity (and its collections) from DB, it “manages” them, ie. tracks their changes. Generally when using Hibernate it’s better not to create any setters for collections (lists, sets). Create only the getter, and clear … Read more

Do NoSQL databases use or need indexes?

CouchDB and MongoDB definitely yes. I mentioned that in my book: http://use-the-index-luke.com/sql/testing-scalability/response-time-throughput-scaling-horizontal Here are the respective docs: http://guide.couchdb.org/draft/btree.html http://www.mongodb.org/display/DOCS/Indexes NoSQL is, however, too fragmented to give a definite “yes, all NoSQL systems need indexes”, I believe. Most systems require and provide indexes but not at level most SQL databases do. Recently, the Cassandra people were … Read more

Evaluating HDF5: What limitations/features does HDF5 provide for modelling data?

How does HDF5 compare against using something like an SQLite DB? Is that even a reasonable comparison to make? Sort of similar but not really. They’re both structured files. SQLite has features to support database queries using SQL. HDF5 has features to support large scientific datasets. They’re both meant to be high performance. Over time … Read more

A step-up from TiddlyWiki that is still 100% portable?

After some time and serious consideration, I will post my own answer. There is nothing that matches TiddlyWiki. As for voluminous information, TW can pretty much handle it. (My early discouragements were due to malformed code.) Difficulty accessing information through the interface becomes an issue before any speed problems. This isn’t to fault the interface … Read more

database: primary key, Clustered or NonClustered

The following statement: CONSTRAINT pk_UserID PRIMARY KEY (U_Id) Is the same as this one: CONSTRAINT pk_UserID PRIMARY KEY CLUSTERED (U_Id) You can only have the table data physicality ordered by one of the indexes, and by default that index is the one used for the primary key (the primary key unique constraint is always supported … Read more

Django is “unable to open database file”

Solution from NewbieMistakes Make sure Apache can also write to the parent directory of the database. SQLite needs to be able to write to this directory. Make sure each folder of your database file’s full path does not start with number, eg. /www/4myweb/db (observed on Windows 2000). If DATABASE_NAME is set to something like ‘/Users/yourname/Sites/mydjangoproject/db/db’, … Read more

Import and export schema in cassandra

To export keyspace schema: cqlsh -e “DESC KEYSPACE user” > user_schema.cql To export entire database schema: cqlsh -e “DESC SCHEMA” > db_schema.cql To import schema open terminal at ‘user_schema.cql’ (‘db_schema.cql’) location (or you can specify the full path) and open cqlsh shell. Then use the following command to import keyspace schema: source ‘user_schema.cql’ To import … Read more

How to configure DB Navigator for Jetbrains PHPStorm and WebStorm

Instructions Install DB Navigator Plugin via menubar >> Settings >> Plugins >> Available-Tab Download MySQL jdbc connector from here >> http://www.mysql.com/downloads/connector/j/ Unpack MySQL jdbc connector to a directory of your choice Restart PHPStorm / WebStorm Add a DB via menubar >> DB Navigator >> Settings >> Connection-Tab >> Plus-Button Enter the parameters for your connection … Read more

Which embedded database to use in a Delphi application?

I’m using Firebird 2.1 Embedded and I’m quite happy with it.I like the fact that the database size is practically unlimited (tested with > 4 GB databases and it works) and that the database file is compatible with the Firebird Server so I can use standard tools for database management and inspection. Distribution consists of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)