Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# isidro 3/25/2008 8:33 PM
Hi there!

First of all, let me excuse me for asking something I know there’s no official assistance, but you know, we poor souls like to push things a little too far every now and then!

I’m trying to user Cuyahoga with SQLite. By now I’ve manage to have it working partiall. I ported all databases and some dummy content I inserted in SQL Server.

After changing slightly Cuyahoga.Core classes to admit these new database systems, I’va started to see … the light! But this journey is not completely clear of troubles. Now when trying to save/update data I’m getting exceptions due to transactions.


Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for Cuyahoga.Core.Domain.Node instance with identifier: 1



I’ve start changing the class CommonDao (Cuyahoga.Core.CommonDao) to remove the original transaction behavior.

[Transaction(TransactionMode.NotSupported)]
public virtual void SaveObject(object obj)
{
ISession session = this._sessionManager.OpenSession();
session.Save(obj);
}

Just for the sake of testing I was trying to understand if it would might solve the problem, but unfortunately this didn’t work.

Can you remember anything that can be tested out here? I’m really trying to make this work. I know SQLite is rather a modest DBMS, but for small traffic websites it is great.

Best regards,
Rui Isidro
# martijnb 3/26/2008 4:17 PM
isidroAfter changing slightly Cuyahoga.Core classes to admit these new database systems, I’va started to see … the light! But this journey is not completely clear of troubles. Now when trying to save/update data I’m getting exceptions due to transactions.


Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for Cuyahoga.Core.Domain.Node instance with identifier: 1

This hasn't anything to do with transactions but with the version timestamps (updatetimestamp field). When the update statement is issues, the original value of the updatetimestamp is also passed to check if it's still the same version. When this is not the case, you'll get this error.
Probably something with the precision of the datetime field, because we also had something like this with Postgres.
# isidro 3/26/2008 4:52 PM
Hi there!

Thanks for your answer. I just figure it out and apparently it has nothing to do with neither transactions nor the timestamp.

Actually it was a matter of actualizing the SQLite database engine (System.data.SQLite.dll - http://sqlite.phxsoftware.com).

For now everything seems to be working just fine. So by now I’m happy with my “CuyahogaLite”.

Thanks!
Rui Isidro

# isidro 3/26/2008 9:28 PM
The next time I’ll keep my mouth shut!

It happens that, after all, not everything is working. I’ve got problems with the Id generators. I’ve been tweaking the mapping files to

< generator class="increment" / >


I know … I know... I shouldn’t be changing things at this level, but I think it’s the only way to make it work in SQLite.

This syntax allowed me to insert new records for instance in Articles. This module is working like a charm. But the Core classes are giving me problems now. If I try to delete or insert new nodes to the menu I’ve got some exceptions.

If I try to delete a node in the menu I’ve got:

An error occured: could not execute query [ select custommenu0_.menuid as menuid16_, custommenu0_.updatetimestamp as updateti2_16_, custommenu0_.name as name16_, custommenu0_.placeholder as placehol4_16_, custommenu0_.rootnodeid as rootnodeid16_ from cuyahoga_menu custommenu0_ inner join cuyahoga_menunode nodes1_ on custommenu0_.menuid=nodes1_.menuid inner join cuyahoga_node node2_ on nodes1_.nodeid=node2_.nodeid where (node2_.nodeid=? ) ] Name: nodeId - Value: 5 [SQL: select custommenu0_.menuid as menuid16_, custommenu0_.updatetimestamp as updateti2_16_, custommenu0_.name as name16_, custommenu0_.placeholder as placehol4_16_, custommenu0_.rootnodeid as rootnodeid16_ from cuyahoga_menu custommenu0_ inner join cuyahoga_menunode nodes1_ on custommenu0_.menuid=nodes1_.menuid inner join cuyahoga_node node2_ on nodes1_.nodeid=node2_.nodeid where (node2_.nodeid=? )]

Adding new nodes is not working too.

Once that the Articles module is working, I suspect that the updatetimestamp is not a problem.

Martijn, since you got previous experience in porting to postgres, will you please give some hints on the path I should take to make this possible?

Best regards,
Rui Isidro