How about specifying db type in mapping?
Tuna Toksöz Eternal sunshine of the open source mind. http://devlicio.us/blogs/tuna_toksoz http://tunatoksoz.com http://twitter.com/tehlike On Sun, May 16, 2010 at 10:51 PM, Nathan Stott <[email protected]> wrote: > Is it a change to the provider? How is that possible. It has to have to > do with NH as NH could easily store GUIDs as varchars if it wanted to. Do > you mean that its a change to the MySQL provider for NH? > > By hand-add I mean now that in workbench, IDs in binary(16) fields appear > as "BLOB" and there is no way I can copy/paste them. Therefore, there is no > way I can manually do anything to my permissions. I will have to write > scripts for even the smallest ad-hoc changes. I do plan on creating a > full-fledged UI for managing security and permissions eventually, but the > ability to do ad-hoc tweeks using the workbench will be missed. > > > On Sun, May 16, 2010 at 3:47 PM, Ayende Rahien <[email protected]> wrote: > >> Not sure that I am following you, this isn't a NH change, it is a change >> in the provider. >> And I don't understand what you mean by hand-add >> >> >> On Sun, May 16, 2010 at 8:44 PM, Nathan Stott <[email protected]> wrote: >> >>> Yes, the community is great. >>> >>> This change to NH really sucks though. Now it will be impossible for me >>> to hand-add permissions via the workbench. If they were varchars this would >>> be quite simple, as it is with SSMS and MSSQL. >>> >>> >>> On Sun, May 16, 2010 at 3:24 PM, Ayende Rahien <[email protected]>wrote: >>> >>>> 53 minutes from problem to solution. >>>> I love OSS >>>> >>>> >>>> On Sun, May 16, 2010 at 8:20 PM, Nathan Stott <[email protected]>wrote: >>>> >>>>> Tuna, >>>>> >>>>> That is _exactly_ what it was. Thank you. >>>>> >>>>> On Sun, May 16, 2010 at 3:07 PM, Nathan Stott <[email protected]>wrote: >>>>> >>>>>> That looks very promising, Tuna! I'll give it a shot >>>>>> >>>>>> >>>>>> On Sun, May 16, 2010 at 3:05 PM, Tuna Toksoz <[email protected]>wrote: >>>>>> >>>>>>> can this be the reason? >>>>>>> >>>>>>> http://stackoverflow.com/questions/1034879/using-guid-as-id-column-in-nhibernate-causes-format-exception-when-using-mysql >>>>>>> >>>>>>> Tuna Toksöz >>>>>>> Eternal sunshine of the open source mind. >>>>>>> >>>>>>> http://devlicio.us/blogs/tuna_toksoz >>>>>>> http://tunatoksoz.com >>>>>>> http://twitter.com/tehlike >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Sun, May 16, 2010 at 10:03 PM, Nathan Stott <[email protected]>wrote: >>>>>>> >>>>>>>> Could it possibly be in NHibernate? >>>>>>>> >>>>>>>> Any suggestions on how I should go about debugging this? I'd really >>>>>>>> like to use Rhino Security with this project. >>>>>>>> >>>>>>>> On Sun, May 16, 2010 at 3:01 PM, Ayende Rahien >>>>>>>> <[email protected]>wrote: >>>>>>>> >>>>>>>>> Hm, no idea then, sorry. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Sun, May 16, 2010 at 8:00 PM, Nathan Stott >>>>>>>>> <[email protected]>wrote: >>>>>>>>> >>>>>>>>>> When using the provider directly, the insert works fine. >>>>>>>>>> >>>>>>>>>> here was my test: >>>>>>>>>> >>>>>>>>>> using (var conn = new >>>>>>>>>> MySqlConnection("server=localhost;database=hampton_calendar;user=root")) >>>>>>>>>> { >>>>>>>>>> conn.Open(); >>>>>>>>>> >>>>>>>>>> using (var cmd = conn.CreateCommand()) >>>>>>>>>> { >>>>>>>>>> cmd.CommandText = "INSERT INTO >>>>>>>>>> security_usersgroups (Name, Parent, Id) VALUES (@name, @parent, >>>>>>>>>> @id)"; >>>>>>>>>> cmd.Parameters.AddWithValue("name", "Test"); >>>>>>>>>> cmd.Parameters.AddWithValue("parent", >>>>>>>>>> DBNull.Value); >>>>>>>>>> cmd.Parameters.AddWithValue("id", >>>>>>>>>> Guid.NewGuid()); >>>>>>>>>> } >>>>>>>>>> >>>>>>>>>> conn.Close(); >>>>>>>>>> } >>>>>>>>>> >>>>>>>>>> On Sun, May 16, 2010 at 2:44 PM, Ayende Rahien <[email protected] >>>>>>>>>> > wrote: >>>>>>>>>> >>>>>>>>>>> When you use the provider directly, can you insert to that table? >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Sun, May 16, 2010 at 7:44 PM, Ayende Rahien < >>>>>>>>>>> [email protected]> wrote: >>>>>>>>>>> >>>>>>>>>>>> What _is_ the recommended value for guids in MySQL? >>>>>>>>>>>> >>>>>>>>>>>> I am sorry, never tried RS on MySQL >>>>>>>>>>>> >>>>>>>>>>>> On Sun, May 16, 2010 at 7:38 PM, Nathan Stott < >>>>>>>>>>>> [email protected]> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> The GUID that Rhino Security is generating for the UserGroup. >>>>>>>>>>>>> It changes everytime. Last one was >>>>>>>>>>>>> 47ef19c0-b865-407c-b9ba-9d7800f0acef >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> On Sun, May 16, 2010 at 2:32 PM, Ayende Rahien < >>>>>>>>>>>>> [email protected]> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> What is the value that it is actually trying to insert/ >>>>>>>>>>>>>> >>>>>>>>>>>>>> On Sun, May 16, 2010 at 7:30 PM, Nathan Stott < >>>>>>>>>>>>>> [email protected]> wrote: >>>>>>>>>>>>>> >>>>>>>>>>>>>>> I'm having some issues with rhino security and MySQL. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> NHibernate creates the tables fine (I'm using NH 2.1.2) but >>>>>>>>>>>>>>> then I get this error when a UserGroup is being created. It >>>>>>>>>>>>>>> created the >>>>>>>>>>>>>>> UserGroup table with Id of VARCHAR(40) and Latin1 collation. I >>>>>>>>>>>>>>> changed this >>>>>>>>>>>>>>> to UTF8 thinking that was the problem, but I get the same >>>>>>>>>>>>>>> error. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Any advice appreciated. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Here is the stack trace: >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> [MySqlException (0x80004005): Incorrect string value: >>>>>>>>>>>>>>> '\xCE\xE9\xA0C\xCDT...' for column 'Id' at row 1] >>>>>>>>>>>>>>> MySql.Data.MySqlClient.MySqlStream.ReadPacket() +251 >>>>>>>>>>>>>>> MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& >>>>>>>>>>>>>>> affectedRows, Int64& lastInsertId) +103 >>>>>>>>>>>>>>> MySql.Data.MySqlClient.MySqlDataReader.GetResultSet() +87 >>>>>>>>>>>>>>> MySql.Data.MySqlClient.MySqlDataReader.NextResult() +1451 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior >>>>>>>>>>>>>>> behavior) +1762 >>>>>>>>>>>>>>> MySql.Data.MySqlClient.MySqlCommand.ExecuteReader() +32 >>>>>>>>>>>>>>> MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() +69 >>>>>>>>>>>>>>> NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand >>>>>>>>>>>>>>> cmd) +303 >>>>>>>>>>>>>>> NHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation >>>>>>>>>>>>>>> expectation) +65 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object >>>>>>>>>>>>>>> id, Object[] fields, Boolean[] notNull, Int32 j, >>>>>>>>>>>>>>> SqlCommandInfo sql, Object obj, ISessionImplementor session) >>>>>>>>>>>>>>> +923 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> [GenericADOException: could not insert: >>>>>>>>>>>>>>> [Rhino.Security.Model.UsersGroup#43a0e9ce-54cd-4963-b29f-9d7800ecce85][SQL: >>>>>>>>>>>>>>> INSERT INTO security_UsersGroups (Name, Parent, Id) VALUES (?, >>>>>>>>>>>>>>> ?, ?)]] >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object >>>>>>>>>>>>>>> id, Object[] fields, Boolean[] notNull, Int32 j, >>>>>>>>>>>>>>> SqlCommandInfo sql, Object obj, ISessionImplementor session) >>>>>>>>>>>>>>> +1321 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object >>>>>>>>>>>>>>> id, Object[] fields, Object obj, ISessionImplementor session) >>>>>>>>>>>>>>> +312 >>>>>>>>>>>>>>> NHibernate.Action.EntityInsertAction.Execute() +368 >>>>>>>>>>>>>>> NHibernate.Engine.ActionQueue.Execute(IExecutable >>>>>>>>>>>>>>> executable) +187 >>>>>>>>>>>>>>> NHibernate.Engine.ActionQueue.ExecuteActions(IList list) +125 >>>>>>>>>>>>>>> NHibernate.Engine.ActionQueue.ExecuteActions() +35 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource >>>>>>>>>>>>>>> session) +221 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> NHibernate.Event.Default.DefaultAutoFlushEventListener.OnAutoFlush(AutoFlushEvent >>>>>>>>>>>>>>> event) +201 >>>>>>>>>>>>>>> NHibernate.Impl.SessionImpl.AutoFlushIfRequired(ISet`1 >>>>>>>>>>>>>>> querySpaces) +295 >>>>>>>>>>>>>>> NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, >>>>>>>>>>>>>>> IList results) +519 >>>>>>>>>>>>>>> NHibernate.Impl.CriteriaImpl.List(IList results) +66 >>>>>>>>>>>>>>> NHibernate.Impl.CriteriaImpl.List() +65 >>>>>>>>>>>>>>> NHibernate.Impl.CriteriaImpl.UniqueResult() +31 >>>>>>>>>>>>>>> NHibernate.Impl.CriteriaImpl.UniqueResult() +44 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Rhino.Security.Services.AuthorizationRepository.GetOperationByName(String >>>>>>>>>>>>>>> operationName) +141 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Rhino.Security.Services.AuthorizationRepository.CreateOperation(String >>>>>>>>>>>>>>> operationName) +224 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> WB.Calendar.Web.Controllers.<>c__DisplayClass25.<InitializeSecurity>b__f(String >>>>>>>>>>>>>>> operation) in >>>>>>>>>>>>>>> C:\working\calendar\src\WB.Calendar.Web\Controllers\DatabaseController.cs:184 >>>>>>>>>>>>>>> System.Collections.Generic.List`1.ForEach(Action`1 action) >>>>>>>>>>>>>>> +56 >>>>>>>>>>>>>>> EnumerableHelper.ForEach(IEnumerable`1 sequence, Action`1 >>>>>>>>>>>>>>> action) +102 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> WB.Calendar.Web.Controllers.<>c__DisplayClass25.<InitializeSecurity>b__e() >>>>>>>>>>>>>>> in >>>>>>>>>>>>>>> C:\working\calendar\src\WB.Calendar.Web\Controllers\DatabaseController.cs:184 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> WB.Calendar.Web.Controllers.<>c__DisplayClass25.<InitializeSecurity>b__d(Action >>>>>>>>>>>>>>> x) in >>>>>>>>>>>>>>> C:\working\calendar\src\WB.Calendar.Web\Controllers\DatabaseController.cs:170 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> WB.Calendar.Web.Controllers.DatabaseController.InitializeSecurity() >>>>>>>>>>>>>>> in >>>>>>>>>>>>>>> C:\working\calendar\src\WB.Calendar.Web\Controllers\DatabaseController.cs:174 >>>>>>>>>>>>>>> lambda_method(ExecutionScope , ControllerBase , Object[] ) >>>>>>>>>>>>>>> +74 >>>>>>>>>>>>>>> System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase >>>>>>>>>>>>>>> controller, Object[] parameters) +17 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext >>>>>>>>>>>>>>> controllerContext, IDictionary`2 parameters) +178 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext >>>>>>>>>>>>>>> controllerContext, ActionDescriptor actionDescriptor, >>>>>>>>>>>>>>> IDictionary`2 parameters) +24 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() >>>>>>>>>>>>>>> +52 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter >>>>>>>>>>>>>>> filter, ActionExecutingContext preContext, Func`1 >>>>>>>>>>>>>>> continuation) +254 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() >>>>>>>>>>>>>>> +19 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext >>>>>>>>>>>>>>> controllerContext, IList`1 filters, ActionDescriptor >>>>>>>>>>>>>>> actionDescriptor, IDictionary`2 parameters) +192 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext >>>>>>>>>>>>>>> controllerContext, String actionName) +399 >>>>>>>>>>>>>>> System.Web.Mvc.Controller.ExecuteCore() +126 >>>>>>>>>>>>>>> System.Web.Mvc.ControllerBase.Execute(RequestContext >>>>>>>>>>>>>>> requestContext) +27 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext >>>>>>>>>>>>>>> requestContext) +7 >>>>>>>>>>>>>>> System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase >>>>>>>>>>>>>>> httpContext) +151 >>>>>>>>>>>>>>> System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext >>>>>>>>>>>>>>> httpContext) +57 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext >>>>>>>>>>>>>>> httpContext) +7 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() >>>>>>>>>>>>>>> +181 >>>>>>>>>>>>>>> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, >>>>>>>>>>>>>>> Boolean& completedSynchronously) +75 >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> -- >>>>>>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>>>>>> Google Groups "Rhino Tools Dev" group. >>>>>>>>>>>>>>> To post to this group, send email to >>>>>>>>>>>>>>> [email protected]. >>>>>>>>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>>>>>>>> [email protected]<rhino-tools-dev%[email protected]> >>>>>>>>>>>>>>> . >>>>>>>>>>>>>>> For more options, visit this group at >>>>>>>>>>>>>>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> -- >>>>>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>>>>> Google Groups "Rhino Tools Dev" group. >>>>>>>>>>>>>> To post to this group, send email to >>>>>>>>>>>>>> [email protected]. >>>>>>>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>>>>>>> [email protected]<rhino-tools-dev%[email protected]> >>>>>>>>>>>>>> . >>>>>>>>>>>>>> For more options, visit this group at >>>>>>>>>>>>>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> -- >>>>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>>>> Google Groups "Rhino Tools Dev" group. >>>>>>>>>>>>> To post to this group, send email to >>>>>>>>>>>>> [email protected]. >>>>>>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>>>>>> [email protected]<rhino-tools-dev%[email protected]> >>>>>>>>>>>>> . >>>>>>>>>>>>> For more options, visit this group at >>>>>>>>>>>>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>> Google Groups "Rhino Tools Dev" group. >>>>>>>>>>> To post to this group, send email to >>>>>>>>>>> [email protected]. >>>>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>>>> [email protected]<rhino-tools-dev%[email protected]> >>>>>>>>>>> . >>>>>>>>>>> For more options, visit this group at >>>>>>>>>>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> You received this message because you are subscribed to the Google >>>>>>>>>> Groups "Rhino Tools Dev" group. >>>>>>>>>> To post to this group, send email to >>>>>>>>>> [email protected]. >>>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>>> [email protected]<rhino-tools-dev%[email protected]> >>>>>>>>>> . >>>>>>>>>> For more options, visit this group at >>>>>>>>>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> You received this message because you are subscribed to the Google >>>>>>>>> Groups "Rhino Tools Dev" group. >>>>>>>>> To post to this group, send email to >>>>>>>>> [email protected]. >>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>> [email protected]<rhino-tools-dev%[email protected]> >>>>>>>>> . >>>>>>>>> For more options, visit this group at >>>>>>>>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "Rhino Tools Dev" group. >>>>>>>> To post to this group, send email to >>>>>>>> [email protected]. >>>>>>>> To unsubscribe from this group, send email to >>>>>>>> [email protected]<rhino-tools-dev%[email protected]> >>>>>>>> . >>>>>>>> For more options, visit this group at >>>>>>>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>>>>>>> >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Rhino Tools Dev" group. >>>>>>> To post to this group, send email to >>>>>>> [email protected]. >>>>>>> To unsubscribe from this group, send email to >>>>>>> [email protected]<rhino-tools-dev%[email protected]> >>>>>>> . >>>>>>> For more options, visit this group at >>>>>>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>>>>>> >>>>>> >>>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Rhino Tools Dev" group. >>>>> To post to this group, send email to [email protected]. >>>>> To unsubscribe from this group, send email to >>>>> [email protected]<rhino-tools-dev%[email protected]> >>>>> . >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Rhino Tools Dev" group. >>>> To post to this group, send email to [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]<rhino-tools-dev%[email protected]> >>>> . >>>> For more options, visit this group at >>>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Rhino Tools Dev" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]<rhino-tools-dev%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/rhino-tools-dev?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Rhino Tools Dev" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<rhino-tools-dev%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/rhino-tools-dev?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Rhino Tools Dev" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<rhino-tools-dev%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rhino-tools-dev?hl=en. > -- You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rhino-tools-dev?hl=en.
